ubunto16.04 mysql安装 远程连接配置

sudo apt-get update
sudo apt-get install mysql-server
//进入数据库
mysql -u root -p
//数据库配置
use mysql;
update user set host = '%' where user = 'root';
grant all privileges on *.* to 'root'@'%' identified by '#####';
flush privileges;
quit;
//修改ip限制
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
//注释或者改ip
bind-address=127.0.0.1 ----->bind-address=0.0.0.0
//保存退出
//重启
sudo service mysql restart

猜你喜欢

转载自blog.csdn.net/weixin_35993084/article/details/80650521