Ubuntu安装mysql没有提示设置密码的问题:
1.首先进入/etc/mysql目录,查看debian.cnf文件cd /etc/mysql
sudo cat debian.cnf
2.使用上面文件中的user和password登录mysqlmysql -udebian-sys-maint -p
3.登录之后,使用如下方法修改root账户的密码
use mysql;
update user set authentication_string=PASSWORD(“你的密码”) where user=‘root’;
update user set plugin=“mysql_native_password”;
flush privileges;
quit;
4.修改完成之后,即可使用root账户和你设置的密码登录mysql了
mysql -uroot -p[你的密码]