Linux mysql service mysql start fail can't run mysql

View error log:

******************************************************************
160104 22:02:31  InnoDB: Waiting for the background threads to start
160104 22:02:32 InnoDB: 5.5.42 started; log sequence number 1595675
160104 22:02:32 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
160104 22:02:32 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
160104 22:02:32 [Note] Server socket created on IP: '0.0.0.0'.
160104 22:02:32 [ERROR] /usr/sbin/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
160104 22:02:32 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
160104 22:02:32 mysqld_safe mysqld from pid file /data/mysqldata/mysqld.pid ended
160104 22:03:11 mysqld_safe Starting mysqld daemon with databases from /data/mysqldata
160104 22:03:11 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
160104 22:03:11 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
160104 22:03:11 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
******************************************************************

or

*****************************************************************
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 
100114 16:13:56 InnoDB: Started; log sequence number 0 0 
100114 16:13:56 [ERROR] Event Scheduler: Failed to open table mysql.event 
100114 16:13:56 [ERROR] Event Scheduler: Error while loading from disk. 
100114 16:13:56 [Note] Event Scheduler: Purging the queue. 0 events 
100114 16:13:56 [ERROR] Aborting 
*******************************************************************

or

*****************************************************************
Starting MySQL...The server quit without updating PID file
*******************************************************************

1.Maybe /usr/local/mysql/data/mysql.pid File does not have write permissions

Solution:  run “chown -R mysql:mysql /var/data” “chmod -R 755 /usr/local/mysql/data” ,then restart mysqld!

2.Maybe a mysql process is alreay running

Solution: Execute Command “ps -ef|grep mysqld” To see if there is mysql process,If there is the mysql process,Execute Command
killall -9 mysqld ,then restart mysqld!

3.Maybe Second installation on mysql ,there is a residual data impact on startup

Solution: View in data directory(/data),if there is a mysql-bin.index file, delete it.

4.Maybe There is no data directory(datadir) in the configuration file(/etc/my.cnf)

Solution: Under [mysqld] setting: datadir = /usr/local/mysql/data

5.Maybeskip-federated field problem

Solution: Comment skip-federated  field in the configuration file(/etc/my.cnf)

6.Error directory does not exist

Solution: Use “chown” “chmod” command Grante mysql Ownership and permissions

7.Maybe selinux Cause problems,if it is centos,default selinux is open.

Solution: 1)temporary close(Do not restart)
            setenforce 0 
          2)Modify the configuration file to restart
            Modify /etc/selinux/config file
            Modify SELINUX=enforcing to SELINUX=disabled
            then restart ok

Pingbacks are closed.

Comments are closed.