首先登录到Ubuntu,这里不多说
1、安装mysql
参考:链接
命令1:sudo apt-get update
命令2:sudo apt-get install mysql-server mysql-client
中间会下载安装资源,大概十几秒
2、配置mysql
命令3:sudo mysql_secure_installation
初始化后,你可能会看到下面的内容
#1
VALIDATE PASSWORD PLUGIN can be used to test passwords…
Press y|Y for Yes, any other key for No: N (我的选项)
#2
Please set the password for root here…
New password: (输入密码)
Re-enter new password: (重复输入)
#3
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them…
Remove anonymous users? (Press y|Y for Ye