Securing new mysql installation


I just installed mysql 4.x on Kubuntu 5.10 via apt-get. I want to
secure the account as per the instructions found at:
http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html

I apparantly have these users:
mysql> select Host, User FROM mysql.user;
+-----------+------------------+
| Host | User |
+-----------+------------------+
| ety | root |
| localhost | debian-sys-maint |
| localhost | root |
+-----------+------------------+
3 rows in set (0.11 sec)

So I proceed tto the first step in the guide, but I get this error:
mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('my_password_here');
ERROR 1133: Can't find any matching row in the user table

What is the proper way to continue Should I use these three commands:
mysql> SET PASSWORD FOR 'root'@'ety' = PASSWORD('my_password_here');
mysql> SET PASSWORD FOR 'debian-sys-maint'@'localhost' =
PASSWORD('my_password_here');
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('my_password_here');

Thank you in advance.
Posted On: Wednesday 24th of October 2012 09:18:06 PM Total Views:  231
View Complete with Replies

RELATED TOPICS OF MYSQL PROGRAMMING LANGUAGE




Wanna help a newbie with install? Here r the errors...

I'm newbie with a PHP/MySQL project. I'm using the sitepoint book by Yank. I already had MySQL installed and running from the Fedora 11 DVD install. I installed Apache from the book, its still workin. Then tried to install PHP and everything was in the wrong place. When I located the mysql_config it would not work for PHP install ./configure file. OK. so I went through yum'n out mysql. I'm going to redo it from scratch as per the book (gee, I hope Apache 'll be ok with that). Right now, mysql is not processing the install script on page 35= [root@xtian mysql]# scripts/mysql_install_db --user=mysql scripts/mysql_install_db: line 205: ./bin/my_print_defaults: cannot execute binary file Neither host 'xtian' nor 'localhost' could be looked up with ./bin/resolveip Please configure the 'hostname' command to return a correct hostname. If you want to solve this at a later stage, restart this script with the --force option Naturally this didn't bother me cuz there is no host yet. I'm using local host and Apache is fine with that right now. I try it with the --force option [root@xtian mysql]# scripts/mysql_install_db --force --user=mysql scripts/mysql_install_db: line 205: ./bin/my_print_defaults: cannot execute binary file Installing MySQL system tables... scripts/mysql_install_db: line 351: ./bin/mysqld: cannot execute binary file Installation of system tables failed! Examine the logs in ./data for more information. You can try to start the mysqld daemon with: ./bin/mysqld --skip-grant &I'm not comfortable doing that yet. especiall since I can't find any explanation in a forum search for the previous problems. and use the command line tool ./bin/mysql to connect to the mysql database and look at the grant tables: shell> ./bin/mysql -u root mysql mysql> show tables Try 'mysqld --help' if you have problems with paths. Using --log gives you a log in ./data that may be helpful.Nope, no mysql --help The latest information about MySQL is available on the web at newbiecantposturls Please consult the MySQL manual section: 'Problems running mysql_install_db', and the manual section that describes problems on your OS. Another information source is the MySQL email archive. Please check all of the above before mailing us! And if you do mail us, you MUST use the ./bin/mysqlbug script! So I tried the manual pages for mysql. According to my install there is a man directory in the mysql directory. It just doesn't work... [root@xtian mysql]# man mysql No manual entry for mysqlWhatever! So maybe it really started and this is all just trying to get on my nerves! No and Yes (^_^)...... [root@xtian /]# /usr/local/mysql/bin/mysqladmin -u root status bash: mysqladmin: command not found[root@xtian /usr/local/mysql/bin]# find ./ -name 'mysqladmin' ./mysqladminAppreciate anyone who wants to explain whats going on step by step. More kudos for what to do next . Xtian
VIEWS ON THIS POST

151

Posted on:

Sunday 21st October 2012
View Replies!

[HELP-newbie] howto make a query base on another result?

Dear Masters and .. I need to make query from another query result. tbl_A fields: ID and Date tbl_B fields: ID and FileName Code: Select ID FROM tbl_A where Date>=CURDATE() this 1st_query_result will be any ID with current date from tbl_A. Then I need this 1st_query_result to query the filename which store at tbl_B. something like this: Code: select FileName from tbl_B where ID = 1st_query_result How would it be done
VIEWS ON THIS POST

127

Posted on:

Sunday 21st October 2012
View Replies!

new: IP-TO-City Help

is there any database or csv file available to convert ip into CITY rather than country
VIEWS ON THIS POST

125

Posted on:

Sunday 21st October 2012
View Replies!

How to add new items to a "field" on the DB from cpanel

I have a site DB [mysql] with stock items which are added by users from the front end, with fields such as item name("stock") and "price" etc. I need to add a few hundred to the db and don't want to do it manually for each listing on the front end of the site(as required by a user). What are the steps to add these items to the "stock" field in the db There are other "fields" for each item added, and I was wondering if I am ok to add the items in one TXT file with a single field ("stock") then add the details once in the db from the front end for each listing.. Or what is the best way Much appreciated!
VIEWS ON THIS POST

111

Posted on:

Sunday 21st October 2012
View Replies!

Please help newbie with MySQL installation

I hate to harass you with a completely newbie question, but I've battled with this for several days. Please lend a hand. I'm following Kevin Yank's book, "Build Your Own DB-Driven Website, Using PHP and MySQL". I installed PHP on my (Windows XP) computer and tested it - worked fine. Then I installed MySQL 5.0 all went well, including the final window of the installation wizard, which said that the installation was successful. Problem occurs when I open mysqld.exe. The "command prompt/dos" window opens, but does not accept any input (keystrokes, etc.). After about 15 seconds, it spontaneously closes. I can open it as many times as I like, but it behaves the same. Now the PHP no longer responds to the date tutorial, which worked previously! Ahhhh! Since then, I've reinstalled the 5.0 and 4.1 versions - on 2 machines several times (after uninstalling each time), reinstalled windows XP on this machine, read this forum for hours, etc. Please could someone put me on the right path or in touch with someone who could help me
VIEWS ON THIS POST

127

Posted on:

Sunday 21st October 2012
View Replies!

newb: SQL Help

I need to retrieve latest record (each record has a time stamp, created_at), only retrieve one record that is latest, from sale table where product_id=1
VIEWS ON THIS POST

111

Posted on:

Monday 22nd October 2012
View Replies!

access denied for root - new database setup

Hi I have started the 'Build Your Own Database Driven Website Using PHP and MySql I have installed PHP and MySql' book, and i have a problem: I have put in the comand prompt mysql -u root mysql This gives me an error 1045 access denied for user root @ localhost Im using xp pro and php if that helps. Im a bit of a newby, but I think somehow the root password has been set, but I know I went through the installation correctly. Please can someone help
VIEWS ON THIS POST

327

Posted on:

Monday 22nd October 2012
View Replies!

Copy partial field value to new field

all, I have a table with state and county in one field. The first 2 characters in all the records indicates the state. Is there a way to copy just these first two characters into a new field in mysql
VIEWS ON THIS POST

97

Posted on:

Monday 22nd October 2012
View Replies!

Help: replacing same text with new text in hundred rows

I have about a couple hundred email addresses in a table... every email address includes @domain.com (the same domain). However, that domain is changing to a new domain... and I need to replace only the @domain.com to @newdomain.com. Any ideas how I do that Ie.. a table might look like this: ID -- email 1 -- aaron@domain.com 2 -- brian@domain.com 3 -- chase@domain.com needs to change to 1 -- aaron@newdomain.com 2 -- brian@newdomain.com 3 -- chase@newdomain.com
VIEWS ON THIS POST

137

Posted on:

Monday 22nd October 2012
View Replies!

Installing database after moving to new host

I am a complete novice at PHP and mysql so I'd really appreciate your help. I have moved my website to a new hosting company and need to install the mysql database file using phpmyadmin. New database details: Database name : db424388701 User name : dbo424388701 This is what it says when I try to install via phpmyadmin... SQL query: -- phpMyAdmin SQL Dump -- version 3. 4. 10. 1 -- phpMyAdmin -- -- Host: localhost:3306 -- Generation Time: Jul 17, 2012 at 01:18 PM -- Server version: 5. 1. 56 -- PHP Version: 5. 3. 10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO" MySQL said: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-- phpMyAdmin SQL Dump -- version 3. 4. 10. 1 -- phpMyAdmin -- --' at line 1 What do I need to change Here's the first section of code... -- phpMyAdmin SQL Dump -- version 3. 4. 10. 1 -- phpMyAdmin -- -- Host: localhost:3306 -- Generation Time: Jul 17, 2012 at 01:18 PM -- Server version: 5. 1. 56 -- PHP Version: 5. 3. 10 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `opencart_5` -- CREATE DATABASE `dbo424388701` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `dbo424388701`; -- -------------------------------------------------------- Please let me know the best way I can find the solution I need to install the database. Thank you, Matthew
VIEWS ON THIS POST

243

Posted on:

Wednesday 24th October 2012
View Replies!

Updating a field with a new value + original field value

UPDATE address SET addaddress = '(Plot:2) 'addaddressid WHERE addaddressid='1' This is SQL statement that wont run. Im sure ive done this before, but cannot think of why its breaking. Basically addaddressid is an address in a particular record, I just want to put (Plot:2) at the begining of the field. So if current value is: 25 Russell Road I want (Plot:2) 25 Russell Road
VIEWS ON THIS POST

88

Posted on:

Wednesday 24th October 2012
View Replies!

Altering existing query from database (sql newbie)

I recently inherited a site, and I am trying to make some changes to it- but I haven't done much with MySQL- could use some help. Here is the existing query- it calls in info on the most recently uploaded video and posts the thumbnail and submitter. PHP Code:
VIEWS ON THIS POST

138

Posted on:

Wednesday 24th October 2012
View Replies!

PHP/MySQL Database solution for newbie?!

I usually design sites using either plain html/css or Wordpress for its CMS capabilities. However, one client has just asked if there can be a database on his site, which they can add to and visitors/members of the site can purchase "entities" from. This obviously needs a database with a usable front-end for the client and an ability to connect to a payment gateway to purchase "entities". Can anyone help advise on a PHP/MySQL package to do this I do not have the skills to build a database from scratch (I plan to learn, but canot do so in the timescales needed for this potential assignment), and I'm presuming there must be a solution out there...
VIEWS ON THIS POST

119

Posted on:

Wednesday 24th October 2012
View Replies!

PHP/MySQL combining query results into new query.

I have 2 tables. The first table contains schools and their details (schools), and the second table contains usernames linked to school names (apps). I am trying to run a query from Flash by using a 'username' to find all of the 'school names' associated with it in the apps table. I then want to get specific details about each individual school from the schools table. I would like to do this in one go, and return all of the data to flash. Here is what I have so far: function get_apps($sUsername) { $sSelect = "SELECT uniname, uniurl, unimentor, unirank, unideadline FROM schools WHERE schoolname = [SELECT schoolname FROM apps WHERE username = '$sUsername']"; $rsData = mysql_query($sSelect); return $rsData; } The above code obviously doesn't work - but how could I implement the above idea
VIEWS ON THIS POST

139

Posted on:

Wednesday 24th October 2012
View Replies!

Results of inner join into a new table

Ive got a DB with 2 tables, one is a contact table, the other is one with postcodes and suburbs. I want to perform and inner join on the two, then put the results of the query into another table so i can export it for a mail merge. Code: CREATE TABLE Merge ( FirstName VARCHAR(50) NOT NULL , LastName varchar(50) NOT NULL , Title varchar(5) NOT NULL , Address varchar(150) not null , Suburb varchar(20) not null , State varchar(3) not null , DateJob date not null , Postcode int(4) ) ENGINE=MyISAM; insert into merge (firstname, lastname, title, address, suburb, state, datejob, postcode) values (1weekletters.FirstName, 1weekletters.lastname, 1weekletters.title, 1weekletters.address, 1weekletters.suburb, 1weekletters.state, 1weekletters.datejob, newcastlepostcodes.postcode); SELECT 1weekletters.firstname, 1weekletters.lastname, 1weekletters.title, 1weekletters.address, 1weekletters.suburb, 1weekletters.state, 1weekletters.datejob, newcastlepostcodes.postcode FROM `1weekLetters` INNER JOIN `NewcastlePostCodes` ON 1weekLetters.suburb = NewcastlePostCodes.name;
VIEWS ON THIS POST

172

Posted on:

Wednesday 24th October 2012
View Replies!

Creating a new column

I'm sure this is very simple but I just can't seem to be able to do it in php. I have a table with a single column named Polar, it is populated with 1000 rows of numbers. I would like to create a new column next to that which is the number in the polar column multiplied by a variable. Polar New_column 2 43 61 218 36 I have given an example above where the variable happens to be 2. The variable will be different each time and is called $new. I will delete the new column at the end of the script so the next user starts from scratch with just the polar column. I have tried alter and I have tried insert with the column already there but I just can't seem to do it.
VIEWS ON THIS POST

117

Posted on:

Wednesday 24th October 2012
View Replies!

PHP MySQL how do I grab newest and first

I have a mysql database with a timestamp and I'm trying to not grab everything but grab the newest timestamp instead. Here's my code Code: $DispQuery = "SELECT * FROM $guestbooktable ORDER BY TimeStamp DESC"; $DispResult = mysql_query($DispQuery) or die(mysql_error().''); while ($Row = mysql_fetch_assoc($DispResult)) {
VIEWS ON THIS POST

94

Posted on:

Wednesday 24th October 2012
View Replies!

Figure out if a thread is new or read already.

, I'm building a forum system for the heck of it and need some help. I can't figure out how to keep track of what threads and posts a user has read so that when you view the categories or list of threads the records that have new posts show bold, like this forum. As best I can tell from trying to look at the SMF and Vanilla code is that they record in a table every thread and post that a user has read. So I have these four tables: Code: topic_log user_id thread_id last_post categories category_id name num_topics num_posts topics topic_id category_id first_post_id last_post_id num_replies posts post_id topic_id post_time poster_user_id How do I get information the information from each category and if that category has new topics or not and then when I click a category to view the list of topics get the information from that topic and if it contains new posts or not. The only way I can think of is to first get a list of all the categories, then for each category find if any of the threads in that category_id have topics.last_post_id > topics_log.last_post for the user_id then the same for when I so all the threads. This seems like a lot of unnecessary hits to the database. Any ideas
VIEWS ON THIS POST

111

Posted on:

Wednesday 24th October 2012
View Replies!

Retrieving news ( by latest date)

[I]I am doing on my final year project. One part is mySql. how come my client's application ( Java) retrieve news from my data base. Cos i faced some problems linking the codes to the time stamp of the data base. Thank you.
VIEWS ON THIS POST

128

Posted on:

Wednesday 24th October 2012
View Replies!

worked on new server even though db info wrong (was "Weirdest Thing EVER!!!!")

I have just encountered the weirdest thing ever that I have no idea why it is happening. I had a site one 1 server switched it over without changing the db username and password and all the stuff worked on the new server even though the db info was wrong. Is there a way to fix this because I feel like thiscan be a major problem later on.
VIEWS ON THIS POST

97

Posted on:

Wednesday 24th October 2012
View Replies!