Mariadb 配置远程访问

执行命令:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
Plain text

编辑:vi /etc/mysql/mariadb.conf.d/50-server.cnf

注释掉下面的行(在前面加#)

# bind-address            = 127.0.0.1
Plain text

最后重启服务

systemctl restart mysql
Plain text

如果找不到该配置在哪个文件里面,可以通过如下命令进行查找:

 grep -r "bind-address" /etc/mysql/*
Plain text

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注