I installed MySQL (server) and then went in and changed the root user's password (in MySQL) with the following query:
Code:
update user set Password=password("newpassword") where User="root";
I then ran "FLUSH PRIVILEGES" and then exited. Now, when I run
Code:
/etc/init.d/mysql restart
it stops properly, but when it tries to restart it says the following:
Code:
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld.
.
FIXME: This is still too noisy but will be changed, soon!
This script updates all the mysql privilege tables to be usable by
MySQL 4.0 and above.
This is needed if you want to use the new GRANT functions,
CREATE AGGREGATE FUNCTION, stored procedures, or
more secure passwords in 4.1
Got a failure from command:
cat /usr/share/mysql/mysql_fix_privilege_tables.sql | /usr/bin/mysql --no-defaults --force --user=root --host=localhost --database=mysql
Please check the above output and try again.
Running the script with the --verbose option may give you some information of what went wrong.
If you get an 'Access denied' error, you should run this script again and give the MySQL root user password as an argument with the --password= option
Checking for crashed MySQL tables in the background.
It just hangs there until I kill the process. Strangely, MySQL starts because I can login and query different databases.
It appears that it is assuming an empty password for the root user becuase when I run (note the -p):
Code:
cat /usr/share/mysql/mysql_fix_privilege_tables.sql | /usr/bin/mysql --no-defaults --force --user=root --host=localhost --database=mysql -p
and enter the password, it works just fine.
It actually dumps a bunch of errors similar to
Code:
ERROR 1060 (42S21) at line 28: Duplicate column name 'Grant_priv'
But from
my research, these errors can be ignored.
My main problem with this whole thing is that the above startup errors are causing my other startup scripts and commands to not execute.
Is there a way I can get the MySQL startup script to use the root password? I would really prefer not to set the root MySQL user's password to be empty.
Thanks.
EDIT:
I noticed the line
Code:
If you get an 'Access denied' error, you should run this script again and give the MySQL root user password as an argument with the --password= option
. Does anyone know where I can modify the script refered to here so I can set the --password="newpassword" flag?