msgbartop
I will happily conduct a FREE basic web security scan for any genuine organization interested in my services to point out whether or not I can find vulnerabilities in your application. Just contact me.
Need a PHP Programmer, PHP staff or project manager? Contact me now.
msgbarbottom

20 Jan 09 How to reset forgotton MySQL root password

As long as you have root access to your debian machine, you can do this as follows:

/etc/init.d/mysql stop #stop MySQL
/usr/bin/mysqld_safe –skip-grant-tables & #start MySQL with –skip-grant-tables
/usr/bin/mysql -u root mysql #connect to mysql as root, straight into the ‘mysql’ database. No password is required
UPDATE user SET password=PASSWORD(’newrootpassword’) WHERE user=’root’; #Do replace ‘newrootpassword’ with something that you’ll remember.
FLUSH PRIVILEGES;
\q #to quit
/etc/init.d/mysql stop #stop MySQL
/etc/init.d/mysql start #start MySQL

You can now test with mysql -u root -p you’ll be prompted for your password and your ‘newrootpassword’ should now work!

Tags: , , , , , , ,



Leave a Comment

You must be logged in to post a comment.