For whatever reason, maybe you are starting a job and have to clean up after the old admin left, you may need to reset the root password for MySQL. It doesn't get simpler than this:
/etc/init.d/mysqld stopThe two update commands change root for localhost, and if you need to access it remotely like from PHPMyAdmin, the second update should take care of that. You probably only need the first update command though.
/usr/bin/mysqld_safe --skip-grant-tables &
mysql -h localhost
use mysql
update user set password = password('newpassword') where user = 'root' and host='localhost';
update user set password = password('newpassword') where user = 'root' and host='%';
quit
/etc/init.d/mysqld restart

1 comments:
Thank you a lot :)
Post a Comment