sudo apt-get update sudo apt install mysql-server
1、由于安装过程中未提示要设置密码,且使用sudo mysql_secure_installation命令过程一直报错:Error: Access denied for user ‘root‘@‘localhost‘ (using password: YES)
解决方法:
sudo cat debian.cnf
用户名: debian-sys-maint
密码:bgZ3yhfFiou0mfGY
登录: mysql -udebian-sys-maint -pbgZ3yhfFiou0mfGY
show databases;
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
腾讯云ubuntu16.04安装MySql5.7未提示密码设置且无法登陆解决
原文:https://www.cnblogs.com/darklights/p/11595344.html