mysql开启远程访问

#1.在连接服务器后,操作mysql系统数据库
mysql -u root -p
use mysql;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'pwd' WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit
nano /etc/mysql/mysql.conf.d/mysqld.cnf
#2.注释掉 bind-address = 127.0.0.1
#3.重启mysql
service mysql restart
#重启
sudo service ssh restart

  

posted @ 2020-08-01 16:22  chen~先生  阅读(189)  评论(0编辑  收藏  举报