Resolve mysql to automatically stop services

Source: Internet
Author: User

I think many of my friends have encountered the problem that the mysql server suddenly stops or starts automatically. Let's analyze the cause and solution to the problem;

Cause 1: the automatic backup function of Mysql may cause the database to shut down the service during backup, but the server does not respond when it is started,

Start-run-services. msc. Open the windows service and find the mysql service. Double-click the recovery tab. The first failure is: "No operation" by default and changed to "Restart service ".
In the "Restart service: Minutes later" below, "0" indicates that the service will be restarted immediately if it is accidentally terminated. Click OK to make the settings take effect. When you wait for the mysql-ntprogress in the task manager, you will find that the progress does not fall. If you want to continue, this kind of mysql.exe cannot be stopped. If you want to stop, you must change the modification back .)

Cause 2: mysql connection problems may occur.
Modify the maximum number of connections of mysql and use the memory variable modification method to modify the maximum number of connections of mysql.
The procedure is as follows (applicable to both windows and linux platforms ):

A. log on to mysql from the client, enter the user name and password 'B', and set the new maximum number of connections to 500 at the mysql Command Prompt: mysql> set global max_connections = 500
C. display the currently running query: mysql> show processlist
D. display the current mysql system parameter status: mysql> show status # k;
E. exit the client: mysql> exit'
To view the maximum number of connections, run the following command in the directory where mysqladmin is located: mysqladmin-username-password variables | find "max_con. You can also use the mysql parameter list in myadmin in the php tutorial to view the maximum number of connections.
Disadvantage: After the computer is restarted or mysql, the maximum number of connections is reset to the initial value. You need to reset the value.
2. modify my. ini or my. cnf file method (mysql needs to be restarted). You can refer to the mysql configuration template in the same directory (small memory, large memory, large memory ). e open my. in the INI file, find the set-variable = max_connections = 100 line, change it to the maximum number of connections to be set, and then restart.
Linux console:
1. Open the my. cnf file: vi/etc/my. cnf
2. In the [mysqld] section, modify the value of max_connections to a set value.
Note:
The source and version of mysql may be different (in windows, the final installation results of mysql + iis and php + apache + mysql suite are almost different), my. the path of the INI file may be somewhat different, my. ini may retain a copy in the c: windows directory that needs to be modified at the same time.


This method was accidentally discovered and tested to be feasible. I will share it with you below.

My computer-> right-click-> service-> Find mysql service double-click a new window-> restore-> set the first failure to restart the service

The failure count for resetting is set to 0 and the Restart service is set to 0.

In this way, the mysql Automatic Stop problem is easily solved.

 

Another situation

100904 22:37:27 InnoDB: Log file. ib_logfile0 did not exist: new to be created
InnoDB: Setting log file. ib_logfile0 size to 10 MB
InnoDB: Database physically writes the file full: wait...
100904 22:37:28 InnoDB: Log file. ib_logfile1 did not exist: new to be created
InnoDB: Setting log file. ib_logfile1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
100904 22:37:29 InnoDB: Started; log sequence number 0 0
100904 22:37:29 [ERROR] Do you already have another mysqld server running on port: 3306?
100904 22:37:29 [ERROR] Aborting

100904 22:37:29 InnoDB: Starting shutdown...
100904 22:37:31 InnoDB: Shutdown completed; log sequence number 0 43655
100904 22:37:31 [Note] wampmysqld: Shutdown complete

100904 22:43:42 InnoDB: Started; log sequence number 0 43655
100904 22:43:42 [ERROR] Do you already have another mysqld server running on port: 3306?
100904 22:43:42 [ERROR] Aborting

100904 22:43:42 InnoDB: Starting shutdown...
100904 22:43:45 InnoDB: Shutdown completed; log sequence number 0 43655
100904 22:43:45 [Note] wampmysqld: Shutdown complete

100904 22:43:49 InnoDB: Started; log sequence number 0 43655
100904 22:43:49 [ERROR] Do you already have another mysqld server running on port: 3306?
100904 22:43:49 [ERROR] Aborting

100904 22:43:49 InnoDB: Starting shutdown...
100904 22:43:52 InnoDB: Shutdown completed; log sequence number 0 43655
100904 22:43:52 [Note] wampmysqld: Shutdown complete

100905 8:23:24 InnoDB: Started; log sequence number 0 43655
100905 8:23:24 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 8:23:24 [ERROR] Aborting

100905 8:23:24 InnoDB: Starting shutdown...
100905 8:23:27 InnoDB: Shutdown completed; log sequence number 0 43655
100905 8:23:27 [Note] wampmysqld: Shutdown complete

100905 8:23:28 InnoDB: Started; log sequence number 0 43655
100905 8:23:28 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 8:23:28 [ERROR] Aborting

100905 8:23:28 InnoDB: Starting shutdown...
100905 8:23:30 InnoDB: Shutdown completed; log sequence number 0 43655
100905 8:23:30 [Note] wampmysqld: Shutdown complete

100905 8:41:35 InnoDB: Started; log sequence number 0 43655
100905 8:41:35 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 8:41:35 [ERROR] Aborting

100905 8:41:35 InnoDB: Starting shutdown...
100905 8:41:37 InnoDB: Shutdown completed; log sequence number 0 43655
100905 8:41:37 [Note] wampmysqld: Shutdown complete

100905 8:41:42 InnoDB: Started; log sequence number 0 43655
100905 8:41:42 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 8:41:42 [ERROR] Aborting

100905 8:41:42 InnoDB: Starting shutdown...
100905 8:41:45 InnoDB: Shutdown completed; log sequence number 0 43655
100905 8:41:45 [Note] wampmysqld: Shutdown complete

100905 8:47:15 InnoDB: Started; log sequence number 0 43655
100905 8:47:15 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 8:47:15 [ERROR] Aborting

100905 8:47:15 InnoDB: Starting shutdown...
100905 8:47:17 InnoDB: Shutdown completed; log sequence number 0 43655
100905 8:47:17 [Note] wampmysqld: Shutdown complete

100905 8:54:20 InnoDB: Started; log sequence number 0 43655
100905 8:54:20 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 8:54:20 [ERROR] Aborting

100905 8:54:20 InnoDB: Starting shutdown...
100905 8:54:23 InnoDB: Shutdown completed; log sequence number 0 43655
100905 8:54:23 [Note] wampmysqld: Shutdown complete

100905 8:54:53 InnoDB: Started; log sequence number 0 43655
100905 8:54:53 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 8:54:53 [ERROR] Aborting

100905 8:54:53 InnoDB: Starting shutdown...
100905 8:54:55 InnoDB: Shutdown completed; log sequence number 0 43655
100905 8:54:55 [Note] wampmysqld: Shutdown complete

100905 8:58:20 InnoDB: Started; log sequence number 0 43655
100905 8:58:20 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 8:58:20 [ERROR] Aborting

100905 8:58:20 InnoDB: Starting shutdown...
100905 8:58:22 InnoDB: Shutdown completed; log sequence number 0 43655
100905 8:58:22 [Note] wampmysqld: Shutdown complete

100905 8:59:57 InnoDB: Started; log sequence number 0 43655
100905 8:59:57 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 8:59:57 [ERROR] Aborting

100905 8:59:57 InnoDB: Starting shutdown...
100905 9:00:00 InnoDB: Shutdown completed; log sequence number 0 43655
100905 9:00:00 [Note] wampmysqld: Shutdown complete

100905 9:02:21 InnoDB: Started; log sequence number 0 43655
100905 9:02:21 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 9:02:21 [ERROR] Aborting

100905 9:02:21 InnoDB: Starting shutdown...
100905 9:02:23 InnoDB: Shutdown completed; log sequence number 0 43655
100905 9:02:23 [Note] wampmysqld: Shutdown complete

100905 9:02:29 InnoDB: Started; log sequence number 0 43655
100905 9:02:29 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 9:02:29 [ERROR] Aborting

100905 9:02:29 InnoDB: Starting shutdown...
100905 9:02:31 InnoDB: Shutdown completed; log sequence number 0 43655
100905 9:02:31 [Note] wampmysqld: Shutdown complete

100905 9:08:16 InnoDB: Started; log sequence number 0 43655
100905 9:08:16 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 9:08:16 [ERROR] Aborting

100905 9:08:16 InnoDB: Starting shutdown...
100905 9:08:18 InnoDB: Shutdown completed; log sequence number 0 43655
100905 9:08:18 [Note] wampmysqld: Shutdown complete

100905 9:08:54 InnoDB: Started; log sequence number 0 43655
100905 9:08:54 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 9:08:54 [ERROR] Aborting

100905 9:08:54 InnoDB: Starting shutdown...
100905 9:08:56 InnoDB: Shutdown completed; log sequence number 0 43655
100905 9:08:56 [Note] wampmysqld: Shutdown complete

100905 9:35:05 InnoDB: Started; log sequence number 0 43655
100905 9:35:05 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 9:35:05 [ERROR] Aborting

100905 9:35:05 InnoDB: Starting shutdown...
100905 9:35:08 InnoDB: Shutdown completed; log sequence number 0 43655
100905 9:35:08 [Note] wampmysqld: Shutdown complete

100905 9:38:08 InnoDB: Started; log sequence number 0 43655
100905 9:38:08 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 9:38:08 [ERROR] Aborting

100905 9:38:08 InnoDB: Starting shutdown...
100905 9:38:10 InnoDB: Shutdown completed; log sequence number 0 43655
100905 9:38:10 [Note] wampmysqld: Shutdown complete

100905 16:18:51 InnoDB: Started; log sequence number 0 43655
100905 16:18:52 [ERROR] Do you already have another mysqld server running on port: 3306?
100905 16:18:52 [ERROR] Aborting

100905 16:18:52 InnoDB: Starting shutdown...
100905 16:18:54 InnoDB: Shutdown completed; log sequence number 0 43655
100905 16:18:54 [Note] wampmysqld: Shutdown complete

Analyzed

Port 3306 is occupied,
1. The previously installed mysql is not uninstalled clean.
2. Other programs (such as the random port number obtained by thunder) occupy port 3306.


In this way, you only need to modify the port in the mysql configuration file.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.