mysql 超时 问题处理

当数据库出现10055和10048错误时,处理办法:

第一 链接超时设置
(1)打开注册表:regedit
找到 HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParametersTcpTimedWaitDelay

如注册表中没有TcpTimedWaitDelay这个项目,请增加项目,并设置为双字节(DWORD)类型数值设置为30 即可

(2)杀掉 administrator -> explorer 

(3)重启电脑

第二 动态端口默认范围 49152 - 65535
mysql 动态端口
netsh int ipv4 set dynamicport tcp start=10000 num=50000
netsh int ipv4 set dynamicport udp start=10000 num=50000
netsh int ipv6 set dynamicport tcp start=10000 num=50000
netsh int ipv6 set dynamicport udp start=10000 num=50000

可以写成bat脚本,统一执行:

@echo off&setlocal enabledelayedexpansion
echo TcpTimedWaitDelay 30
reg add "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesTcpipParameters" /v "TcpTimedWaitDelay" /t REG_DWORD /d 30 /f
echo ipv4 tcp
netsh int ipv4 set dynamicport tcp start=10000 num=50000
echo ipv4 udp
netsh int ipv4 set dynamicport udp start=10000 num=50000
echo ipv6 tcp
netsh int ipv6 set dynamicport tcp start=10000 num=50000
echo ipv6 udp
netsh int ipv6 set dynamicport udp start=10000 num=50000
pause

原文地址:https://www.cnblogs.com/lyy-php/p/4679933.html