carlos1234
deepin
2019-02-09 04:50 已解决
使用sudo cat /etc/mysql/debian.cnf查看用户名和密码并用其登录
之后使用use mysql;命令选中mysql数据库
用命令update user set authentication_string=password("这里填写自定义密码") where user="root";更新user表
然后再使用update user set plugin="mysql_native_password" where user="root"命令更新user表
使用flush privileges;命令
最后,退出,使用systemctl restart mysql.service命令重启mysql即可使用root用户登录。
使用sudo cat /etc/mysql/debian.cnf查看用户名和密码并用其登录
之后使用use mysql;命令选中mysql数据库
用命令update user set authentication_string=password("这里填写自定义密码") where user="root";更新user表
然后再使用update user set plugin="mysql_native_password" where user="root"命令更新user表
使用flush privileges;命令
最后,退出,使用systemctl restart mysql.service命令重启mysql即可使用root用户登录。
Reply Like 0 View the author


中文 
