您好,登錄后才能下訂單哦!
今天在更新ROOT密碼時(shí)出錯(cuò)
update user set password='123456' where user ="root" 這樣寫是錯(cuò)的
應(yīng)該為update user set password = password ('123456') where user = "root"
錯(cuò)誤操作之后,導(dǎo)致mysql數(shù)據(jù)庫消失了。
解決方法:
關(guān)閉/etc/init.d/mysqld stop
然后,usr/bin/mysqld_safe --skip-grant-tables
啟動(dòng)/etc/init.d/mysqld start
mysql -u root
mysql> use mysql
mysql> UPDATE user SET Password=PASSWORD('xxx') WHERE user='root';