安装mysql-server
sudo apt-get install mysql-server mysql-common mysql-client
更改mysql root账户认证模式
sudo mysql
`select user, plugin from mysql.user;
update mysql.user set authentication_string=PASSWORD('123456'), plugin='mysql_native_password' where user='root';`flush privileges;
exit
重启mysql-server
sudo systemctl restart mysql
以下可选操作,允许root远程登陆不安全
配置root远程登陆
grant all on *.* to root@'%' identified by '123456' with grant option;
flush privileges;
exit
修改侦听地址127.0.0.1为0.0.0.0
vi /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address = 0.0.0.0
评论 (0)