您好,我正在尝试默认连接到cpanel上的远程mysql数据库
我已经在cpanel中访问了我试图用来连接到远程数据库的IP
我试着改变/etc/mysql/mysql.conf.d/mysqld.conf
[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
#skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 189.251.13.63
#
# * Fine Tuning
#
key_buffer_size = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#保存更改后,我转到/etc/init.d/,然后执行mysqld restart
尝试使用sudo mysql,但它一直转到我的本地数据库,我哪里做错了?
发布于 2020-06-05 18:05:34
您可以使用以下输入创建$HOME/.my.cnf:
[client]
user=...
host=...
port=...当您在命令行中没有给出其他选项时,mysql客户端应该从此配置文件中获取默认连接参数。
https://stackoverflow.com/questions/62205596
复制相似问题