ubuntu安装mysql-server 5.7时未提示输入密码的解决办法

sudo vim /etc/mysql/debian.cnf
password = hGu99nJgoWcmCDKT
找到password 后这段长密码

mysql -u debian-sys-maint -p 此长密码

use mysql;

update user set authentication_string=PASSWORD("自定义密码") where user='root';

update user set plugin="mysql_native_password";

flush privileges;

quit;

/etc/init.d/mysql restart;

mysql -u root -p 密码;
OK成功


你可能感兴趣的:(ubuntu安装mysql-server 5.7时未提示输入密码的解决办法)