简体   繁体   English

MariaDB不允许远程连接

[英]MariaDB not allowing remote connections

在此输入图像描述

在此输入图像描述

As the screenshots show, I have the accounts setup to allow remote connections but as shown in the second screenshot I still cannot connect remotely. 截图显示,我设置了帐户以允许远程连接,但如第二个屏幕截图所示,我仍然无法远程连接。

Mysql by default binds to 0.0.0.0 which is all interfaces on your system. 默认情况下,Mysql绑定到0.0.0.0,这是系统上的所有接口。 Which means you can already connect from another computer. 这意味着您已经可以从另一台计算机连接。 The issue is perhaps permissions. 问题可能是权限。 You can enable remote connections by running the following command: 您可以通过运行以下命令来启用远程连接:

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

I use for testing in the virtual machine (Ubuntu 16.04), for me, I fixed the error changing the file 50-server.cnf . 我在虚拟机(Ubuntu 16.04)中用于测试,对我来说,我修正了更改文件50-server.cnf的错误。

My server is Ubuntu, so changing the file below: 我的服务器是Ubuntu,所以更改下面的文件:

50-server.cnf

The path of this file: 这个文件的路径:

/etc/mysql/mariadb.conf.d

PS: Create a backup of the file before the change. PS:在更改之前创建文件的备份。

Only change in file the bind-address 127.0.0.0 to bind-address 0.0.0.0 只将文件bind-address 127.0.0.0更改为bind-address 0.0.0.0

After this restart service and try again. 重启此服务后再试一次。

Regarding that user, need to allow for external connections. 对于该用户,需要允许外部连接。

I hope that this info helps you. 我希望这些信息对您有所帮助。

MariaDB packages bind MariaDB to 127.0.0.1 (the loopback IP address) by default as a security measure using the bind-address configuration directive. MariaDB软件包默认将MariaDB绑定到127.0.0.1(环回IP地址)作为使用bind-address配置指令的安全措施。 Old MySQL packages sometimes disabled TCP/IP networking altogether using the skip-networking directive. 旧MySQL包有时使用skip-networking指令禁用TCP / IP网络。

Steps to allow remote connections are provided in the MariaDB Knowledge Base at https://mariadb.com/kb/en/mariadb/configuring-mariadb-for-remote-client-access/ MariaDB知识库中提供了允许远程连接的步骤, 网址https://mariadb.com/kb/en/mariadb/configuring-mariadb-for-remote-client-access/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM