安裝
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