无法从远程客户端连接Mariadb
问题描述:
我无法从客户端连接数据库服务器。 客户端的ID是serviceAdmin,并且该ID具有所有权限。无法从远程客户端连接Mariadb
- 我们的服务器操作系统:Ubuntu的16.04LTS
我们的数据库:MariaDB的10.1稳定
我们的服务器端口的状态。
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp6 0 0 :::80 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
这是我们的数据库的用户列表。
+--------------+------------------+
| User | Host |
+--------------+------------------+
| serviceAdmin | % |
| root | 127.0.0.1 |
| root | ::1 |
| root | stories2-h8dm8-2 |
+--------------+------------------+
当然无效已经
sudo ufw status
Status: inactive
防火墙,但客户端(serviceAdmin)不能从外部访问数据库。奇怪的是该客户端(serviceAdmin)可以访问本地网络示例的phpmyadmin
==========================
附加
我扫描了我的服务器端口,结果令人难以置信
PORT STATE SERVICE
21/tcp closed ftp
22/tcp open ssh
23/tcp closed telnet
80/tcp open http
443/tcp closed https
3306/tcp closed mysql
8080/tcp closed http-proxy
我该如何解决它?
答
看看你的问题的开始是netstat
输出:
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
这意味着,你的数据库服务器只监听的localhost
地址。它不是可以远程访问的。您可以使用bind-address选项更改此行为。
LoooooooooL duuuuude你的权利 – stories2