安装
apt-get install mysql-server
设置root密码
mysql -uroot -p
>use mysql;
>update user set authentication_string='111111', password_expired='N', plugin='mysql_native_password' from user
>where user='root' and host='localhost';
>quit;
设置远程访问
vi /etc/mysql/mysql.conf.d/mysqld.cnf
注释掉bind-address = 127.0.0.1
进入mysql,执行授权命令
grant all on *.* to root@'%' identified by '111111' with grant option;
flush privileges;
重启服务
service mysql restart