mysql 資料庫忘記了密碼處理
阿新 • • 發佈:2018-12-10
在安裝完了忘記了登陸資料庫的密碼,可以做以下的處理:
1、修改root密碼
sudo more /etc/mysql/debian.cnf
用檔案裡的使用者名稱密碼登陸Mysql
use mysql
update user set plugin='mysql_native_password' where user='root';
update user set authentication_string=password('123') where user='root';
flush privillege;
2、配置遠端訪問資料庫
註釋掉在/etc/MySQL
連線mysql資料庫,修改user表
Grantall on *.* to 'root'@'%' identifiedby 'root使用者的密碼' withgrant option;flush privileges;