ให้ทำตาม step ดังนี้
[root@host]# /etc/init.d/mysqld stop
[root@host]# mysqld --skip-grant-tables --user=root
แล้วก็ login mysql ใหม่โดยใช้ mysql client
[root@host]# mysql
mysql> USE mysql
mysql> UPDATE user SET password=password("newpassword") WHERE user="root";
mysql> flush privileges;
mysql> exit;
[root@host]# /etc/init.d/mysqld restart
mysql> USE mysql
mysql> UPDATE user SET password=password("newpassword") WHERE user="root";
mysql> flush privileges;
mysql> exit;
[root@host]# /etc/init.d/mysqld restart
No comments:
Post a Comment