如何在centos6.5系統(tǒng)修改MySQL默認(rèn)用戶root的密碼
2016-06-24 15:39:48
12864
1.用默認(rèn)賬號密碼登錄MySQL服務(wù)端
[root@domin ~]# mysql -u root -p
2.切換到mysql庫
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
3.執(zhí)行更改密碼的語句
mysql> update user set password=password('landui') where user='root';
Query OK, 3 rows affected (0.01 sec)
Rows matched: 3 Changed: 3 Warnings: 0
4.刷新權(quán)限表
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
5.現(xiàn)在退出就可以用新密碼登錄啦~
mysql> exit;
Bye