MysqlTheserverquitwithoutupdatingPIDfile exception Solution

Source: Internet
Author: User
Server symptoms: Today, the website web page submits content to the database and finds an error. I cannot submit it all the time. I have searched for the cause and found that the data cannot be written! First, I restarted the mysql database and kept running. I couldn't start it if I couldn't stop it. I intuitively told me that the disk was full! Run the df command to check whether the disk is full.

Server symptoms: Today, the website web page submits content to the database and finds an error. I cannot submit it all the time. I have searched for the cause and found that the data cannot be written! First, I restarted the mysql database and kept running. I couldn't start it if I couldn't stop it. I intuitively told me that the disk was full! Run the df command to check whether the disk is full.

Server symptoms:

Today, the web page of the website submits content to the database and finds an error. I cannot submit it all the time. I have searched for the cause and found that the data cannot be written! First, I restarted the mysql database and kept running. I couldn't start it if I couldn't stop it. I intuitively told me that the disk was full! Run the df command to check whether the disk is full. Because the system default partition is used at that time, I don't know why I cannot resize it automatically! We will handle this issue later! :

[Root @ rekfan ~] # Df
File System 1 K-block used available % mount point
/Dev/mapper/vg_rekfan-lv_root
51606140 47734848 1249852 100%/
Tmpfs 1953396 88 1953308 1%/dev/shm
/Dev/sda1 495844 37062 433182 8%/boot
/Dev/mapper/vg_rekfan-lv_home
229694676 191796 217835016 1%/home
[Root @ rekfan ~] #

An error occurred while restarting the database after deleting useless logs. Http://blog.rekfan.com /? P = 186

[Root @ rekfan mysql] # service mysql restart
MySQL server PID file cocould not be found! [Failed]
Starting MySQL... The server quit without updating PID file (/usr/local/mysql/data/rekfan. pid). [failed]

There are many possible causes of the problem after google's deployment. The best way to do this is to check the Error Log First:

1. It may be that the/usr/local/mysql/data/rekfan. pid file has no write permission.
Solution: grant permissions, execute "chown-R mysql: mysql/var/data" "chmod-R 755/usr/local/mysql/data", and then restart mysqld!

2. the mysql process may already exist in the process.
Solution: Run "ps-ef | grep mysqld" to check whether the mysqld process exists. If the "kill-9 process number" is used to kill the process and restart mysqld!

3. It may be the second time that mysql is installed on the machine. Residual data affects service startup.
Solution: Go to the mysql data DIRECTORY/data to see, if there is a mysql-bin.index, just remove it, it is the culprit. I am using the third solution! Http://blog.rekfan.com /? P = 186

4. mysql uses/etc/my when the configuration file is not specified at startup. cnf configuration file. Open this file to check whether the data directory (datadir) is specified in [mysqld ).
Solution: Set this line in [mysqld]: datadir =/usr/local/mysql/data

5. skip-federated Field Problems
Solution: Check whether the skip-federated field has been commented out in the/etc/my. cnf file. If so, comment out the field immediately.

6. The error log directory does not exist.
Solution: use the "chown" "chmod" command to grant the mysql owner and permissions.

7. selinux. If it is a centos system, selinux is enabled by default.
Solution: Close it, open/etc/selinux/config, change SELINUX = enforcing to SELINUX = disabled, and then save the disk and restart the machine.

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.