Mysql开启远程连接

vim /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address            = 0.0.0.0
use mysql;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456';
flush privileges; 
/etc/init.d/mysql restart

修改密码:mysql> set password for root@localhost = password('123');

原文地址:https://www.cnblogs.com/steinven/p/11363433.html