系统:Ubuntu 16.04
1、更新源地址
sudo apt-get update
2、安装mysql
sudo apt-get install mysql-server
-
安装过程中会提示设置密码:
3、运行远程连接mysql
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mysql密码' WITH GRANT OPTION;
mysql> flush privileges; # 重新加载mysql权限
-
查询是否修改成功:
mysql> use mysql; mysql> select user, host from user;
4、bind-address设置
编辑/etc/mysql/mysql.conf.d/mysqld.cnf,注释掉这一行
bind-address = 127.0.0.1
重启mysql,通过navcat测试连接成功:
sudo service mysql restart