Mysql Automatic Stop Cause Analysis and Solution

Source: Internet
Author: User
Tags mysql tutorial

Mysql tutorial Automatic Stop Cause Analysis and Solution

Start Menu-run-services. msc

Find the mysql service and double-click

Click the recovery tab.

First failure: the default value is "no operation", which is changed to "Restart service ".

Add "0" after "Restart service: ___ minutes" below to indicate that the service will be restarted immediately if it is unexpectedly terminated.

Click OK to make the settings take effect.

At this time, you end the mysql-nt process in the task manager and you will find that the process cannot end.

In other words, 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

1. 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 and enter the user name and password.

B. At the mysql command prompt, set the new maximum number of connections to 500: 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

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 the my. ini or my. cnf file method (mysql needs to be restarted). For details, refer to the mysql configuration template in the same directory (small memory, large memory, and ultra-large memory)

In windows:

Open the my. 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:

Open the my. cnf file: vi/etc/my. cnf

In the [mysqld] section, modify the value of max_connections to a set value.

Tianyuan note: the source and version of mysql may be different (the final installation results of mysql + iis and php + apache + mysql in windows 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.

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.