安装服务端和客户端
sudo apt-get install mysql-server
sudo apt install mysql-client
进入mysql
mysql -uroot -p
授权
grant all on *.* to root@'%' identified by '数据库密码' with grant option; flush privileges;
编辑 /etc/mysql/my.cnf
有的会在 /etc/mysql/mysql.conf.d/mysqld.cnf里编辑
注释掉bind-address = 127.0.0.1
重启mysql服务
service mysql restart