安装MySQL
sudo apt-get install mysql-server
中间需要设置root密码和确认密码
sudo apt-get install mysql-client
sudo apt-get install libmysqlclient-dev
配置MySQL远程登录
修改MySQL配置文件
配置文件路径:/etc/mysql/mysql.conf.d/mysqld.cnf
注释bind-address这行
登录MySQL
grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
重启MySQL
sudo service mysql restart
网友评论