Just copy pasted the tutorials i saw so that i need not google again .
If you have set a root password, but forgot what it was, you can set a new password with the following procedure:
- Take down the
mysqldserver by sending akill(notkill -9) to themysqldserver. The pid is stored in a `.pid' file, which is normally in the MySQL database directory:shell> kill `cat /mysql-data-directory/hostname.pid`
You must be either the Unixrootuser or the same usermysqldruns as to do this. - Restart
mysqldwith the--skip-grant-tablesoption. - Set a new password with the
mysqladmin passwordcommand:shell> mysqladmin -u root password 'mynewpassword'
- Now you can either stop
mysqldand restart it normally, or just load the privilege tables with:shell> mysqladmin -h hostname flush-privileges
- After this, you should be able to connect using the new password.
mysql client: - Take down and restart
mysqldwith the--skip-grant-tablesoption as described above. - Connect to the
mysqldserver with:shell> mysql -u root mysql
- Issue the following commands in the
mysqlclient:mysql> UPDATE user SET Password=PASSWORD('mynewpassword')
-> WHERE User='root';
mysql> FLUSH PRIVILEGES; - After this, you should be able to connect using the new password.
- You can now stop
mysqldand restart it normally.



No comments:
Post a Comment