MariaDB错误2002(HY000):无法连接到xxx.xxx.xxx.xxx(10060)上的MySQL服务器

时间:2018-10-29 06:20:00

标签: python mysql mariadb windows-server-2008 pymysql

我在服务器计算机(Windows Server)上构造数据库服务器,并将它们与远程数据库访问一起使用。 DB包含大量数据(一个表包含30列和500万数据) 问题是有时我无法连接到MySQL服务器(使用root)。 我尝试了Stack Overflow线程中的所有操作,但最终都失败了。

似乎在数据库交互时停止(我制作的)python代码后失败。 我的意思是...

db.connect(host, name, password, port, cursor...)
// Do some queries (insert, update) (lots of -- about 3 million rows will be added and modified if there are no problems.)
//<----------- python pops errors and exit improperly by dtype mismatch errors(I need to modify this code so that it works properly.)
db.close() <-- will not be executed because python is stopped by error.

我想知道的是,如果交互时未正确关闭数据库,这会导致数据库连接错误吗?

当发生这种情况时,我总是检查服务器(重新启动dbs,更改db中的内存设置)。但找不到问题或解决方案。 但是仍然可以从服务器计算机作为本地主机根与db连接 之后,我等待了大约3到5个小时,并且db运行正常(可以连接到db)

我可以假定数据库交互中的失败会导致此问题吗?

加法:: 我的服务器计算机不好。使用与第5个i5 CPU类似的8GB RAM

(来自SHOW GLOBAL STATUS:)

 connect_timeout    10
 deadlock_timeout_long  50000000
 deadlock_timeout_short 10000
 delayed_insert_timeout 300
 idle_readonly_transaction_timeout  0
 idle_transaction_timeout   0
 idle_write_transaction_timeout 0
 innodb_flush_log_at_timeout    1
 innodb_lock_wait_timeout   50
 innodb_rollback_on_timeout OFF
 interactive_timeout    28800
 lock_wait_timeout  86400
 net_read_timeout   30
 net_write_timeout  60
 rpl_semi_sync_master_timeout   10000
 rpl_semi_sync_slave_kill_conn_timeout  5
 slave_net_timeout  60
 thread_pool_idle_timeout   60
 wait_timeout   28800

0 个答案:

没有答案
相关问题