ubuntu安装mysql未设置密码

打开 /etc/mysql debian.cnf
里面会有账号密码 使用登录 修改密码。

进入之后执行sql语句

use mysql;
// 下面这句命令有点长,请注意。
update mysql.user set authentication_string=password('root') where user='root' and Host ='localhost';
update user set plugin="mysql_native_password"; 
flush privileges;
quit;

root的密码设置为root

参照地址

猜你喜欢

转载自blog.csdn.net/ppwwp/article/details/83151416
今日推荐