Mariadb 无法远程连接

在Ubuntu 18.04.2上,遇到了MariaDB Ver 15.1不能远程连接的问题,错误代码2003。解决方法包括:注释掉/etc/mysql/mariadb.conf.d/50-server.cnf中的bind-address,赋予USER_NAME全库权限,刷新权限表,最后重启MariaDB服务。
摘要由CSDN通过智能技术生成

MariaDB15远程连接问题

环境

mariadb Ver 15.1 Distrib 10.1.38-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Ubuntu 18.04.2

问题

mysql -h 192.168.0.5 -u root -p

报错如下:

ERROR 2003 (HY000): Can’t connect to MySQL server on ‘192.168.0.4’ (111 “Connection refused”)

解决方法

参考官方解释(真香)
https://mariadb.com/kb/en/library/configuring-mariadb-for-remote-client-access/

  1. 把/etc/mysql/mariadb.conf.d/50-server.cnf 下面的bind-address 注释掉,如下所示:
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address           = 127
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值