mysql - 如何远程或通过 IP 地址连接到 mariaDB?
问题描述
mysql -V
mysql Ver 15.1 Distrib 10.3.23-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
我可以连接:
mysql -h localhost -uroot -pmysecretPassword
然后我尝试连接
mysql -h XXX.XXX.XXX.XXX -uroot -pmysecretPassword
并得到 ERROR 1045 (28000): Access denied for user 'root'@'ns10003.XXXXX' (使用密码: YES)
其中 XXX.XXX.XXX.XXX 是我的服务器 IP
我用
telnet XXX.XXX.XXX.XXX 3306
我得到了一个连接:mysql 在端口 3306 上的 XXX.XXX.XXX.XXX 上运行
我的配置mysql文件/etc/mysql/mariadb.conf.d/50-server.cnf
是
[mysqld]
innodb_strict_mode = 0
sql-mode="NO_ENGINE_SUBSTITUTION"
#
# * Basic Settings
#
user = mysql
pid-file = /run/mysqld/mysqld.pid
socket = /run/mysqld/mysqld.sock
#port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
#skip-external-locking
#skip-networking=1
#skip-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.0.0.1
bind-address = 0.0.0.0
一切对我来说都很好。没有 iptables 规则:
为什么我不能远程连接到我的服务器或使用它的 IP?
解决方案
推荐阅读
- php - WP:如何根据位置更改电话号码
- c# - 如何使用 JSESSIONID c# 获取请求?
- ios - 在 SceneKit 中更改“视野”
- python - 在熊猫的一列上重塑数据框
- visual-studio-code - Visual Studio Code:是否可以使装饰悬停消息可点击
- ios - 在 Swift 4 中点击单元格时如何可视化 tableViewCell 中的变化
- vba - 编译错误语法错误 Vba
- python - 使用networkx库提高graph()函数在python中读取txt文件的效率
- tensorflow - 张量流中的停止梯度
- c - 堆栈中的弹出函数(C)