MySQL startup service error solution _ MySQL

Source: Internet
Author: User
This topic describes the problem caused by an error when starting the mysql service. It also expands some other knowledge points. The current version is redhat6 and mysql5.6. Directory overview step error reporting source problem resolution problem analysis system automatic restart service summary step error reporting source Problem Resolution 1. Permission Overview

This article mainly introduces the problem caused by an error when starting the mysql service, along with some other knowledge points. The current version is red hat 6 and mysql 5.6.

Directory

Overview

Procedure

Error source

Problem solving

Problem analysis

The system automatically restarts the service.

Summary

Procedure

Error source

Problem solving

1. permission

The error is reported at the source. Generally, the first problem is the permission problem, that is, the permission of the/var/lib/mysql folder.

You can see that the user and group in the mysql folder are both mysql and mysql has the write permission, so the permission is correct.

2. process

View the/var/lib/mysql Directory. if the mysql. sock file is not found, it indicates that mysql is not started. you can also log on to mysql to test

View process ps-ef | grep mysql

The mysql process is found because it is killed and killed-9 pid

Start the mysql service again. for service mysql start, my current mysql version is 5.6. for service mysql start in mysql 5.7, it is slightly different.

View the mysql directory and find that the mysql. sock file is generated.

Problem analysis

Do you still remember the first error?

The mysql process already exists, but the stop mysql service prompts that the process cannot be found. The main reason is that the mysql process is stored in the process. The solution is to kill these processes according to the preceding command, why does this process occur? Here is my own operation error. mysql was automatically started when the server was started, and then I executed a service mysql start, which caused this problem. this is also the cause of the problem, there are many articles on the Internet to solve this problem, but they have not found out the cause of the problem. There may be other reasons that cause this problem, but here I started the service again, mysql 5.6 does not automatically restart mysql.

The system automatically restarts the service.

Chkconfig command

Run the chkconfig command to query the restart status of the service. run the command chkconfig -- list servername. you can also view all

[0-6] represents the operating mode of the linux system, 0: downtime, 1: Single user mode, 2: non-network users, 3: non-graphic users, 4: not used. 5: In the graphic interface mode x11, you will often see the linux desktop (default level), and 6: restart.

You can use the chkconfig -- level service name on/off method to disable and start the service.

For example, we disable automatic startup of mysql at linux2, 3,4, and 5 running levels,

Chkconfig -- level 2345 mysql off

Here is a good summary of the article on auto start service: overview

This article mainly introduces the problem caused by an error when starting the mysql service, along with some other knowledge points. The current version is red hat 6 and mysql 5.6.

Directory

Overview

Procedure

Error source

Problem solving

Problem analysis

The system automatically restarts the service.

Summary

Procedure

Error source

Problem solving

1. permission

The error is reported at the source. Generally, the first problem is the permission problem, that is, the permission of the/var/lib/mysql folder.

You can see that the user and group in the mysql folder are both mysql and mysql has the write permission, so the permission is correct.

2. process

View the/var/lib/mysql Directory. if the mysql. sock file is not found, it indicates that mysql is not started. you can also log on to mysql to test

View process ps-ef | grep mysql

The mysql process is found because it is killed and killed-9 pid

Start the mysql service again. for service mysql start, my current mysql version is 5.6. for service mysql start in mysql 5.7, it is slightly different.

View the mysql directory and find that the mysql. sock file is generated.

Problem analysis

Do you still remember the first error?

The mysql process already exists, but the stop mysql service prompts that the process cannot be found. The main reason is that the mysql process is stored in the process. The solution is to kill these processes according to the preceding command, why does this process occur? Here is my own operation error. mysql was automatically started when the server was started, and then I executed a service mysql start, which caused this problem. this is also the cause of the problem, there are many articles on the Internet to solve this problem, but they have not found out the cause of the problem. There may be other reasons that cause this problem, but here I started the service again, mysql 5.6 does not automatically restart mysql.

The system automatically restarts the service.

Chkconfig command

Run the chkconfig command to query the restart status of the service. run the command chkconfig -- list servername. you can also view all

[0-6] represents the operating mode of the linux system, 0: downtime, 1: Single user mode, 2: non-network users, 3: non-graphic users, 4: not used. 5: In the graphic interface mode x11, you will often see the linux desktop (default level), and 6: restart.

You can use the chkconfig -- level service name on/off method to disable and start the service.

For example, we disable automatic startup of mysql at linux2, 3,4, and 5 running levels,

Chkconfig -- level 2345 mysql off

There's a good summary of an article about auto start service: http://www.bitsCN.com/ OS /201301/185495.html

View boot. log logs

Command: cat/var/log/boot. log

Boot. log records the log information of the startup item.

Summary

This article mainly describes how to locate the problem when you encounter a problem, and expands some information about automatic startup of the system.

View boot. log logs

Command: cat/var/log/boot. log

Boot. log records the log information of the startup item.

Summary

This article mainly describes how to locate the problem when you encounter a problem, and expands some information about automatic startup of the system.

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.