1.查看系统版本
2.安装
sudo apt-get install mysql-client mysql-server
3.查找配置文件
执行完2的命令后,mysql即安装成功,但是在安装过程中没有提示输入用户名密码,name就是默认给我们生成好了。查找配置sudo cat /etc/mysql/debian.cnf
文件,即可看到:
4.修改用户名和密码[新的用户名/密码为:root/root]
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
如下图所示:
5.验证登录