【发布时间】:2020-04-27 08:35:27
【问题描述】:
这似乎是一个非常具体的问题,但我们在使用 MYSQL 工作台时遇到了连接远程数据库的问题。工作台无法建立连接并给我错误
查询期间与 MySQL 服务器的连接丢失
我已经通过命令行测试了相同的凭据,它可以毫无问题地建立连接。此外,我尝试使用另一个程序(DBeaver)和同样的东西,我能够毫无问题地连接。所以这似乎是 MYSQL 工作台的问题。
事情变得有点复杂,因为我正在连接到 ProxySql 服务器(这就是为什么端口是 6033 而不是 3306),它指向带有数据库的服务器。我检查了安装,它按预期的方式工作。但我不明白为什么这会对我从 Workbench 连接的能力产生任何影响。如果我可以从命令行连接,我不应该能够从 Workbench 连接吗?
编辑: 我将日志设置为调试以获得更详细的输出
这是我尝试建立连接时记录的内容。
11:41:57 [DB3][SQL Editor Form]: Creating KeepAliveInterval timer...
11:41:57 [DB1][ mforms managed]: Looking up password for service: Mysql@IPADDRESS:6033, account: fuser
11:41:57 [DB1][ mforms managed]: Loading password cache
11:41:57 [DB1][ mforms managed]: Get special folder
11:41:57 [DB2][ mforms managed]: Decrypting password data
11:41:57 [DB2][ mforms managed]: Filling password cache
11:41:57 [DB1][ mforms managed]: Unloading password cache
11:41:57 [DB1][ mforms backend]: Looking up password for 'fuser'@'Mysql@IPADDRESS:6033' has succeeded
11:41:57 [DB1][ mforms managed]: Running a cancelable wait message
11:41:57 [DB3][ WQE backend]: Connecting SQL editor...
11:41:57 [DB3][ GRT task]: Sending task "execute sql queries" to dispatcher (wait)...
11:41:57 [DB1][ GRTDispatcher]: starting worker thread
11:41:57 [DB1][ GRTDispatcher]: worker thread running
11:41:57 [DB3][ GRTDispatcher]: Running task "execute sql queries"
11:41:57 [DB2][SQL Editor Form]: Notifying server state change of Mysql@IPADDRESS:6033 to not running
11:41:57 [ERR][SQL Editor Form]: SqlEditorForm: exception in do_connect method: Exception: Lost connection to MySQL server during query
11:41:57 [WRN][SQL Editor Form]: Lost connection to MySQL server during query
11:41:57 [ERR][SQL Editor Form]: Connection failed but remote admin does not seem to be available, rethrowing exception...
11:41:57 [ERR][ GRTDispatcher]: exception in grt execute_task, continuing: Exception: Lost connection to MySQL server during query
11:41:57 [DB3][ GRTDispatcher]: Task "execute sql queries" finished
11:41:57 [ERR][ GRTDispatcher]: worker: task 'execute sql queries' has failed with error:.Lost connection to MySQL server during query
11:41:57 [DB2][ mforms managed]: HUD window returned with code: 3
11:41:57 [DB2][ mforms backend]: forgetting cached password for 'fuser'@'Mysql@IPADDRESS:6033'
11:41:57 [DB2][ GRTDispatcher]: Main thread waiting for background thread to finish
11:41:57 [DB2][ GRTDispatcher]: Background thread finished
11:41:57 [ERR][SQL Editor Form]: SQL editor could not be connected: Lost connection to MySQL server during query
11:41:57 [ERR][SQL Editor Form]: Your connection attempt failed for user 'fuser' to the MySQL server at IPADDRESS:6033:
Lost connection to MySQL server during query
Please:
1 Check that MySQL is running on address IPADDRESS
2 Check that MySQL is reachable on port 6033 (note: 3306 is the default, but this can be changed)
3 Check the user fuser has rights to connect to IPADDRESS from your address (MySQL rights define what clients can connect to the server and from which machines)
4 Make sure you are both providing a password if needed and using the correct password for IPADDRESS connecting from the host address you're connecting from
11:41:57 [DB1][ mforms managed]: Showing an error to the user
11:41:57 [DB1][ mforms managed]: Hiding the wait message
11:41:57 [DB2][ mforms managed]: Wait message was not visible, nothing to do
11:41:57 [DB1][ mforms managed]: About to show a custom message box
11:41:57 [DB1][ mforms managed]: Creating and showing custom message box
11:41:57 [DB1][ mforms managed]: Running custom message box
11:41:58 [DB1][ mforms managed]: Custom message box closed
11:41:58 [DB2][ grt]: wb.form.showQueryConnectDialog finished in 3.96s
任何帮助将不胜感激。
【问题讨论】:
-
不走运。我将所有这些数字都设置得很高并重新启动了 Workbench,但没有任何变化。我也立即得到错误,它不会挂起几秒钟然后错误。它只是吐出错误。
-
您是否尝试过阅读 ssh keep alive 上的链接?既然你提到了代理。只是说
-
我尝试增加迁移时间和所有 ssh 连接超时字段。仍然无法建立连接。如果其中有任何用处,我已经用更详细的设置更新了日志输出。
-
我也面临着类似的问题。我可以通过 putty 终端连接到数据库,但无法通过 MySQL 工作台连接。更令人惊讶的是,我能够通过工作台通过管理员用户进行连接,但不能通过任何其他用户进行连接。但是所有用户在 putty 中都可以正常工作
标签: mysql mysql-workbench