close

修改 vi /etc/my.cnf
在 [mysqld]下面 加入下面的一行
一定要加在mysqld這句下面

skip-grant-tables

存檔後重啟mysqld 服務。
接著,你可以使用任何用戶名以root管理員的身份登錄 MySQL 了。

[root@dbsvr1 ~]# mysql -u root
mysql>  update mysql.user set password=password("123456") 
    ->  where user="root" and host="localhost";
 mysql>  flush privileges;
 mysql>  exit
 使用新密碼123456重新登錄

arrow
arrow
    文章標籤
    mysql linux
    全站熱搜

    nL 發表在 痞客邦 留言(0) 人氣()