无法远程连接到mariadb服务器

7gyucuyw  于 2021-06-17  发布在  Mysql
关注(0)|答案(0)|浏览(334)

当我的flask应用程序尝试远程连接到名为ceres的服务器时,我得到一个错误消息

OperationalError: (2003, "Can't connect to MySQL server on 'ceres.local' (65)")

所以我查了一下 my.cnf 文件如下所示

ciasto@ceres:/etc/mysql $ cat my.cnf

# The MariaDB configuration file

# 

# The MariaDB/MySQL tools read configuration files in the following order:

# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,

# 2. "/etc/mysql/conf.d/*.cnf" to set global options.

# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.

# 4. "~/.my.cnf" to set user-specific options.

# 

# If the same option is defined multiple times, the last one will apply.

# 

# One can use all long options that the program supports.

# Run program with --help to get a list of available options and with

# --print-defaults to see which it would actually understand and use.

# 

# This group is read both both by the client and the server

# use it for options that affect everything

# 

[client-server]

# Import all .cnf files from configuration directory

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

[mysqld]

# skip-networking

# bind-address = <some ip-address>

# Fine Tuning

max_allowed_packet      = 128M

wait_timeout = 28800
interactive_timeout = 28800

绑定地址是评论,我相信它是开放前接受所有远程连接,但我的应用程序仍然无法连接到mariadb在远程机器上运行mysql。
同样在应用程序运行一天之后,我总是会出错 MySQL server has gone away.

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题