一、 mysql 数据库的安装
sudo apt-get install mysql-server
二 、 查看自定义安装的 用户名及密码
- 查看文件中debian-sys-maint的密码
sudo cat /etc/mysql/debian.cnf
- 使用该密码登录
mysql -u debian-sys-maint -p (debian-sys-maint-password)
- 连接上mysql后更改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;