mysql 远程表 超时时间,远程MySQL访问需要很长时间

Running a MySQL query on a local database takes only about 20-30ms but running the same query through a remote connection(internet) takes 500ms. Is this normal? If not what could be the possible reason for such delay?

This is a wireshark time extract for a particular Query run remotely.

Time -195.768993000 --- Request Ping

Time -195.909453000 --- Response OK

Time -195.909729000 --- Request Use Database

Time -196.049567000 --- Response OK

Time -196.049918000 --- Request Query

Time -196.219660000 --- Response

NOTE: I tried running the same query remotely through workbench and the duration of execution was 200ms.This I think matches time taken from 'Request Query' to 'Response' in C# as shown in the wireshark data above.

解决方案

It could be because of a DNS problem. You can disable DNS host name lookups by starting mysqld with the --skip-name-resolve option in the configuration file.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值