【问题标题】:Unable to connect MariaDB 10.3 remotely on CentOS 7.6在 CentOS 7.6 上无法远程连接 MariaDB 10.3
【发布时间】:2023-04-02 02:04:01
【问题描述】:

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

Output of grep

我也找不到 .cnf 文件。

Output of cd /etc --> ls

谁能帮我解决这个问题。

【问题讨论】:

  • 你使用的mysql账号是否设置接受远程连接?
  • 是的,我创建了一个用户:CREATE USER 'user'@'%' IDENTIFIED BY 'pwd';授予 * 上的所有特权。 * TO '用户'@'%';刷新特权;

标签: mysql linux mariadb centos7


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2017-04-20
    • 2018-12-27
    • 1970-01-01
    • 2022-11-28
    • 2021-11-20
    • 2017-11-03
    • 1970-01-01
    • 2018-02-18
    • 1970-01-01
    相关资源
    最近更新 更多