Recently, the server database collapsed from time to time and was depressed. I found a lot of methods and did not solve them. Convert these methods. After the server is started for a period of time, MySQL will automatically fail ~ The problem can be solved only after restart. We recommend that you use mysql4.x for beginners. 5 is indeed not perfect. In addition, this problem cannot be solved simply. I hope other friends who have encountered this problem can be inspired by the help ~~~ Description 1: Server configurations: win2003, serv-u6.0, mysql-4.0.24, php-4.3.11, SQL2000 After the server runs for a period of time, the PHP website cannot be opened, and the error "can't connect to MySQL server on 'localhost' (10055)" is returned. Restarting the MySQL service does not work, but only the server is restarted. However, this error occurs several days later. My. ini configuration content: # This file was made using the winmysqladmin 1.4 Tool #2005-6-26 16:53:57 # Uncomment or add only the keys that you know how works. # Read the MySQL manual for instructions [Mysqld] Basedir = C:/MySQL # Bind-address = 192.168.13.81 Datadir = C:/MySQL/Data # Language = C:/MySQL/share/your language directory # Slow query log # = # Tmpdir # = # Port = 3306 # Set-variable = key_buffer = 16 m [Winmysqladmin] Server = C:/MySQL/bin/mysqld-nt.exe User = root Password = % -------------------------------------------------------------------------------- Description 2: Can't connect to MySQL server on 'localhost' (10055) (2003) Can't connect to MySQL server on 'localhost' (10048) (2003) my system is 2003, and the above error occurs repeatedly in MySQL for a while .... restart, but the problem is coming again after a while... research Direction description 3: my MySQL has always encountered an error recently and the 'localhost' (10055) error is prompted! The following message is displayed: -------------------------------------------------------------------------------- MYSQL: Ready for connections MYSQL: ready for connections Cannot initialize InnoDB as 'innodb _ data_file_path 'is not set. if you do not want to use transactional InnoDB tables, add a line skip-InnoDB to the [mysqld] section of init parameters in your my. CNF or my. ini. if you Want to use InnoDB tables, add to the [mysqld] section, for example, innodb_data_file_path = ibdata1: 10 m: autoextend but to get good performance you shoshould adjust for your hardware the InnoDB startup options listed in section 2 at http://www.innodb.com/ibman.html 050621 13:25:20 MYSQL: normal shutdown 050621 13:25:20 MYSQL: shutdown complete MYSQL: Ready For connect Ions -------------------------------------------------------------------------------- what does it mean? In addition, you must restart the machine after each error. It is useless to restart the MySQL service. Solution reference (online) I: I think it may be that some of the main program writing problems, may occupy the connection but not disconnect. In addition, does the MySQL server have a firewall installed? In particular, the Norton Firewall, I once met that it clearly allowed my IP address to access the protected server. However, after a while, Norton thought that my IP address was an illegal attack, the IP address is automatically blocked. Wait for 20 minutes (the default rule), or restart the server ....... II:This item is used with caution. After I change it, viview always has internal server errors. You are using a Windows operating system. This error is related to a registry key value tcptimedwaitdelay. Reduce the tcptimedwaitdelay time in Windows to solve this problem. The default value is 240 (this value is also not set ). This setting must be set at the following location in the Registry: hkey_local_machinesystemcurrentcontrolsetservicestcpipparameterstcptimedwaitdelay If the registry does not contain the tcptimedwaitdelay project, add the project and set it to the dual-byte (DWORD) type. Set the value to 30 ~ Between 60. III: After the Server FTP test is completed, restart it. Everything is stable. However, there are still a few questions that have not been clarified. Don't worry. 1. When the FTP pressure was not high last Friday and more than 900 people were online for 30 minutes, the 10% error of MySQL connection failure occurred at a rate of 10048. 2. The connection method I used at the time was mysql_connect (). Server IIS + PHP + ISAPI. After referring to some materials, I immediately changed the mysql_connect () method to the mysql_pconnect () method. At that time, the problem seemed to be resolved. 3. On Saturday, the server started the FTP stress test. A 15% error occurred when MySQL connection fails at a rate of 10048. The error code is 10055 more than the previous one. Key unknown 10048 10055 ErrorCodeError message. It should be said that no definite answer is found to the question. I opened Serv-U and had four socket connections. MySQL immediately went to the Data Mining Institute. IV: Can't connect to MySQL server on 'localhost' (10048) Can't connect to MySQL server on 'localhost' (10055) MySQL 4.0.13-NT Server: Windows2000 Server + iis5.0 + PhP ISAPI + MySql I developed a web site using PHP + MySQL, which has a high access volume. However, after more than a week of normal operation, the can't connect to MySQL server on 'localhost' (10048) error is frequently reported. The statistical data is as follows: 10,594 Failed Connections Total connections per hour: 885.37 % 15.91% We can see that the connection failure rate is very high. It should be emphasized that there was no such high error rate in the same number of links a week ago. Cause Analysis: using the fport tool, you will find that someone is exhausting your database connection. Obviously, their feature is that dozens of connections come from the same IP address, all of which are time-waitk Solution:1. We recommend that you modify the maximum number of connections, or change the mysql_connect () method to the mysql_pconnect () method, 2. Block these IP addresses. If an IP address is greater than 3, It is abnormal. 3. Fix the problem and modify the website program. Refresh is prohibited too quickly! Note: you can block the local port 3306 from the firewall! |