First, you will need to make sure whether the default user is 'admin' or 'root' or whatever. You will then need to reset the password.
Start the mysql server instance or daemon with the --skip-grant-tables option. (security setting) You can do it by adding the "skip-grant-tables" in the server section of /etc/my.cnf then restart mysql service by #service mysql restart
Then Execute these statements.
# mysql -u root mysql
mysql> SELECT Host, User FROM mysql.user;
+-------------------------------------------+------------------+
| Host | User |
+-------------------------------------------+------------------+
| localhost | admin |
|-------------------------------------------+------------------+
1 row in set (0.00 sec)
mysql> UPDATE user SET Password=PASSWORD('your_new_password') where USER='The_user_@_localhost';
mysql> FLUSH PRIVILEGES;
mysql> quit
bye
After that, restart the instance/daemon without the --skip-grant-tables option. (ie. modify the /etc/my.cnf AND # service mysql restart IF you follow the above)
You should be able to connect with your new password.
# mysql -u root -p OR # mysql -u admin -p
Enter password: your_new_password
阅读(1894) | 评论(0) | 转发(0) |