执行命令:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
编辑:vi /etc/mysql/mariadb.conf.d/50-server.cnf
注释掉下面的行(在前面加#)
# bind-address = 127.0.0.1
最后重启服务
systemctl restart mysql
如果找不到该配置在哪个文件里面,可以通过如下命令进行查找:
grep -r "bind-address" /etc/mysql/*