無論設置什么密碼,都不起作用。登錄時輸入任何密碼都可以進去。在mysql內查看顯示如下:MariaDB [mysql]> select authentication_string from user;authentication_string1 row in set (0.00 sec)MariaDB [mysql]> select user from user;userroot1 row in set (0.00 sec)MariaDB [mysql]> select host from user;hostlocalhost1 row in set (0.00 sec)
1 回答

慕少森
TA貢獻2019條經驗 獲得超9個贊
解決了,是mysql密碼驗證方式有問題。
select Host,User,plugin from mysql.user where User='root';
這個時候會發現plugin(加密方式)是unix_socket,
update mysql.user set plugin='mysql_native_password'; #重置加密方式update mysql.user set password=PASSWORD("newpassword") where User='root'; #設置新密碼
flush privileges; #刷新權限信息
然后就可以正常使用
添加回答
舉報
0/150
提交
取消