Navicat is slow to connect to MySql database

Project scene:

Operate MySql database

Problem Description:

Connecting to MySql database tables through Navicat, the first time you open the table is normal, but when you open other tables after you haven't operated Navicat for a period of time, it will get stuck, and it will take a long time to respond.

Cause Analysis:

My database is placed on the recently purchased Tencent server. I wonder if the configuration of the MySql database just installed is not configured properly, so I searched the Internet for such problems and said that MySql has enabled Dns reverse analysis by default. I tried the following configuration methods
Add such a field under mysqlid in /etc/my.cnf:

skip-name-resolve

After the configuration, I found that the problem still exists. Then I found an article through the query that the Navicat client has a mechanism to keep the connection interval. The default is 240 seconds, which means that the client will give MySql every 240 seconds when the user has no operation. The server sends a request to keep the database active.
However, because the interval time set by Navicat is too long, the previous database connection has been disconnected. When we open a new table, Navicat will take the old connection to request, and only apply for a new one after finding that the old one is unavailable. Connect to the request, so it will cause us to open a table for so long

solution:

Modify Navicat's keep-alive interval time

Navicat-Edit database connection-Advanced-Check Keep connection interval-Set the input box to 30-Click OK!
![Insert picture description here](https://img-blog.csdnimg.cn/20210225151649891.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNz_AMT1QFF,size_FF,size

Guess you like

Origin blog.csdn.net/junwen0814/article/details/114083812