1.使用命令进行安装
1 | sudo apt-get update |
2.检查
1 | sudo netstat -tap | grep mysql |
3.设置mysql远程访问
注释掉bind-address = 127.0.0.1:1
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
4.链接mysql进行授权
1 | mysql -u root -p |
执行sql进行授权1
2
3
4
5mysql> use mysql;
mysql> select 'host' from user where user='root';
mysql> update user set host = '%' where user = 'root';
mysql> flush privileges;
mysql> select 'host' from user where = 'root';
5.重启mysql服务
1 | /etc/init.d/mysql restart |