保证能如命令行进入MYSQL

mysql> use mysql;

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root'
WITH GRANT OPTION

刷新权限

flush privileges; 

修改配置文件

/etc/mysql/my.conf或者在
/etc/mysql/mysql.conf.d
注释掉此行

#bind-address           = 127.0.0.1

如果找不到bind-address

root@php56:/etc/mysql# find /etc/mysql/ -name "*.cnf" |xargs grep "bind-address"

./mysql.conf.d/mysqld.cnf:bind-address        = 127.0.0.1
root@php56:/etc/mysql# 

1045

GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'A!abc123456.' WITH GRANT OPTION;


牙小木木
1.5k 声望80 粉丝

iamtb.cn