- Ensure that you have stopped all running instances of mysqld
Create a text file and place the following command
within it on a single line:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');
Save the file with any name. For this example the file
will be~/mysql-init.
Restart the MySQL server with the special
--init-file=~/mysql-initoption:
shell>
mysqld_safe --init-file=~/mysql-init &
The contents of the init-file are executed at server
startup, changing the root password. After the server
has started successfully you should delete
~/mysql-init.
You should be able to connect using the new password.
Saturday, February 16, 2008
Resetting mysql password
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment