sudo /etc/init.d/mysql stop
Now start up MySQL in safe mode, so you'll skip the privileges table:
sudo mysqld_safe --skip-grant-tables &
Login with root:
mysql -uroot
And assign the DB that needs to be used:
use mysql;
Now all you have to do is reset your root password of the MySQL user and restart the MySQL service:
update user set authentication_string=password('1111') where user='root';
flush privileges;
quit and restart MySQL:
quit
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start
No comments:
Post a Comment