无法在CentOS 7.6上远程连接MariaDB 10.3

时间:2019-03-26 00:24:27

标签: mysql linux mariadb centos7

我正在尝试从远程计算机连接MariaDB 10.3(安装在CentOS 7.6上),但是我无法连接。

Output of grep

enter image description here

我也找不到.cnf文件。

Output of cd /etc --> ls

enter image description here 谁能帮我解决这个问题。

1 个答案:

答案 0 :(得分:0)

my.cnf(在Windows上为my.ini)

->用您的IP地址替换

bind-address        = 123.456.789.10

然后

CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypass';
CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypass';

最后

GRANT ALL ON *.* TO 'myuser'@'localhost';
GRANT ALL ON *.* TO 'myuser'@'%';

还要检查您的iptables和Firewalld

systemctl status firewalld
systemctl status iptables

iptables -L
firewall-cmd --list-all-zones