Forgot root-password database to MySQL? It does not matter. It can be easily restored.
Stop the service:
# /etc/init.d/mysql stop
and restart it manually with ignoring privileges:
# mysqld_safe –skip-grant-tables &
Now we can create a new password:
# mysql -u root
Stop the service:
# /etc/init.d/mysql stop
and restart it manually with ignoring privileges:
# mysqld_safe –skip-grant-tables &
Now we can create a new password:
# mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD(”new_password”) where User=’root’;
mysql> flush privileges;
mysql> quit
And restart MySQL in normal mode:
# /etc/init.d/mysql restart
This is that what I did in my Mac OS.
in terminal:
cd /usr/local/mysql/bin/mysql
the end
mysql> quit
And restart MySQL in normal mode:
# /etc/init.d/mysql restart
This is that what I did in my Mac OS.
in terminal:
cd /usr/local/mysql/bin/mysql
mysql> use mysql;
mysql> update user set password=PASSWORD(”new_password”) where User=’root’;
No comments:
Post a Comment