天天看點

2021-03-26 Access denied for user 'root'@'localhost' (using password: yes)

 Access denied for user 'root'@'localhost' (using password: yes)

關于修改mysql密碼

1.在mysql安裝目錄下的my.ini 檔案中加入代碼 skip-grant-table;(設定無密碼登入)

2.重新開機mysql.    net stop mysql;    net start mysql     mysql -uroot - p    直接enter進入

3.在MySQL 5.7 password字段已從mysql.user表中删除,新的字段名是“authenticalion_string”.

選擇資料庫:use mysql;

更新root的密碼:update user set authentication_string=password('新密碼') where user='root' and Host='localhost';        (這裡的新密碼開始用了字母不行的話可以用下數字)

重新整理權限:flush privileges;

42.重新開機mysql.    net stop mysql;    net start mysql 

繼續閱讀