MySQL database displays The server quit without updating PID file.

Source: Internet
Author: User

LNMP1.0 can be used to quickly build a PHP environment in a Linux system. Previously, the LNMP environment has been used to operate other servers, and similar errors have not been detected. Now we will record the solution process.

I. server environment

Operating System: CentOS-6.4

Server Environment: Integrated Environment LNMP1.0

2. Step Reproduction

1. Install LNMP1.0. For more information, see here. The installation is successful;

2. for personal needs, store MySQL data in/data/mysql/var and modify/etc/my. cnf datadir =/data/mysql/var. Do not forget to set the/var directory permission to chown-R mysql. mysql/data/mysql;

3. restart the service,/root/lnmp restart;

4. error message: Starting MySQL... The server quit without updating PID file [failed]/mysql/var/localhost. localdomain. pid ).;

Iii. troubleshooting errors

  1. According to the prompts, the PID may be incorrect. According to the conventional solution, kill related processes and clear selinux. the problem still exists;

2. view the error log,/usr/local/mysql/var/localhost. localdomain. pid

140513 11:59:34 mysqld_safe Starting mysqld daemon with databases from /data/mysql/var/usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist140513 11:59:34 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.140513 11:59:34 InnoDB: The InnoDB memory heap is disabled140513 11:59:34 InnoDB: Mutexes and rw_locks use GCC atomic builtins140513 11:59:34 InnoDB: Compressed tables use zlib 1.2.3140513 11:59:34 InnoDB: Initializing buffer pool, size = 16.0M140513 11:59:34 InnoDB: Completed initialization of buffer poolInnoDB: The first specified data file /data/mysql/var/ibdata1 did not exist:InnoDB: a new database to be created!140513 11:59:34  InnoDB: Setting file /data/mysql/var/ibdata1 size to 10 MBInnoDB: Database physically writes the file full: wait...140513 11:59:34  InnoDB: Log file /data/mysql/var/ib_logfile0 did not exist: new to be createdInnoDB: Setting log file /data/mysql/var/ib_logfile0 size to 5 MBInnoDB: Database physically writes the file full: wait...140513 11:59:34  InnoDB: Log file /data/mysql/var/ib_logfile1 did not exist: new to be createdInnoDB: Setting log file /data/mysql/var/ib_logfile1 size to 5 MBInnoDB: Database physically writes the file full: wait...InnoDB: Doublewrite buffer not found: creating newInnoDB: Doublewrite buffer createdInnoDB: 127 rollback segment(s) active.InnoDB: Creating foreign key constraint system tablesInnoDB: Foreign key constraint system tables created140513 11:59:35  InnoDB: Waiting for the background threads to start140513 11:59:36 InnoDB: 1.1.8 started; log sequence number 0140513 11:59:36 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306140513 11:59:36 [Note]   - '0.0.0.0' resolves to '0.0.0.0';140513 11:59:36 [Note] Server socket created on IP: '0.0.0.0'.140513 11:59:36 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist140513 11:59:36 mysqld_safe mysqld from pid file /data/mysql/var/localhost.localdomain.pid ended

3. According to the log prompt, it may be mysql. the plugin data table does not exist. Copy the original database directory/usr/local/mysql/var/* To/data/mysql/var/and restart the mysql service/etc/init. d/mysql start. the problem persists;

4. Return to the database directory and check that the data permission is root. root, reset the data permission: chown mysql. mysql/data/mysql/, restart mysql service/etc/init. d/mysql start,Solve the problem.;

Iv. Summary

 It is inevitable that errors occur in the Linux environment. The error logs of MySQL faults are not very clear, so you need to analyze and control the error logs. Therefore, data must be backed up on a daily basis, and data can be recovered in the event of a Data Disaster.

 

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.