Squirrel sql客户端会话超时
它与它是什么版本无关,只是想了解如何更改(当然增加)Squirrel Sql Client 的会话超时值。因为我真的厌倦了出现某种异常“发送到服务器的最后一个数据包是......之前”
任何帮助将不胜感激。
It is not related to whatever version it is, just working to find out how to change (of course increase) session timeout value of Squirrel Sql Client. Because I really get bored of getting kind of exception "Last packet sent to the server was .. ago"
Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以通过执行以下操作来保持连接处于活动状态:
在别名上->修改选定的别名(铅笔图标)->属性->连接(选项卡)
选中启用Keep-Alive
并输入一个简单的查询,在PostgreSQL中我使用
SELECT 1;
,在Oracle中应该类似于从双选择 1
You can keep the connection alive by doing the following:
On Aliases->Modify the Selected Alias (pencil icon)-> Properties-> Connection (tab)
Check Enable Keep-Alive
and enter a simple query, in PostgreSQL I use
SELECT 1;
, in Oracle should be something likeSELECT 1 FROM dual
MySQL 的解决方案:
Solution for MySQL:
我的本地开发机器也遇到了同样的问题。由于 SQuirreL 不鼓励使用驱动程序属性“autoReconnect”,因此我寻找了另一种解决根本原因的替代方案。
我可以访问 Linux VM 上的
/etc/mysql/my.cnf
目录,因此我可以调整变量wait_timeout
。以前,它设置为600
(600 / 每分钟 60 秒 = 10 分钟)。然后我将其设置为28800
这是 MariaDB 默认。使用
service mysql restart
重新启动 MySQL 服务器后,一切都非常顺利!I faced the same problem with my local development machine. Since using the driver property "autoReconnect" is discouraged by SQuirreL, I looked for another alternative which fixes the root cause.
I have access to the
/etc/mysql/my.cnf
directory on my Linux VM, so I could tweak the variablewait_timeout
. Previously, it was set to600
(600 / 60 seconds per minute = 10 minutes). I then set it to28800
which is the MariaDB default.After restarting the MySQL server using
service mysql restart
, everything worked like a charm!如果您要连接到 Apache Derby 数据库,请使用以下保持活动测试 SQL:
If you're connecting to an Apache Derby db, use the following keep-alive test SQL:
在安装目录中找到
prefs.xml
并将默认的loginTimeout
值更改为您想要的值,然后就完成了。Locate the the
prefs.xml
in the installation directory and change the defaultloginTimeout
value to your desired value and you are done.