首页 > 解决方案 > 在 CentOS 7.6 上无法远程连接 MariaDB 10.3

问题描述

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

Output of grep

在此处输入图像描述

我也找不到 .cnf 文件。

Output of cd /etc --> ls

在此处输入图像描述 谁能帮我解决这个问题。

标签: mysqllinuxmariadbcentos7

解决方案


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

推荐阅读