MYSQL [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11

1:重启

[root@iZuf63x5aylgn2n11k2sllZ etc]# systemctl restart mysql
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.

日志:

2019-04-16T10:00:46.450639Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2019-04-16T10:00:47.450753Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2019-04-16T10:00:47.450808Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2019-04-16T10:00:47.450827Z 0 [Note] InnoDB: Unable to open the first data file
2019-04-16T10:00:47.450856Z 0 [ERROR] InnoDB: Operating system error number 11 in a file operation.
2019-04-16T10:00:47.450893Z 0 [ERROR] InnoDB: Error number 11 means 'Resource temporarily unavailable'
2019-04-16T10:00:47.450908Z 0 [Note] InnoDB: Some operating system error numbers are described at http://dev.mysql.com/doc/refman/5.7/en/operating-system-error-codes.html
2019-04-16T10:00:47.450918Z 0 [ERROR] InnoDB: Cannot open datafile './ibdata1'
2019-04-16T10:00:47.450930Z 0 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2019-04-16T10:00:47.450946Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Cannot open a file
2019-04-16T10:00:47.751293Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-04-16T10:00:47.751337Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-04-16T10:00:47.751349Z 0 [ERROR] Failed to initialize builtin plugins.
2019-04-16T10:00:47.751356Z 0 [ERROR] Aborting

2019-04-16T10:00:47.751375Z 0 [Note] Binlog end
2019-04-16T10:00:47.751517Z 0 [Note] Shutting down plugin 'MyISAM'
2019-04-16T10:00:47.751563Z 0 [Note] Shutting down plugin 'CSV'
2019-04-16T10:00:47.751892Z 0 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

3:查看

[root@iZuf63x5aylgn2n11k2sllZ etc]# systemctl status mysql.service
● mysql.service - LSB: start and stop MySQL
   Loaded: loaded (/etc/rc.d/init.d/mysql; bad; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2019-04-16 18:00:48 CST; 4min 31s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 10859 ExecStop=/etc/rc.d/init.d/mysql stop (code=exited, status=0/SUCCESS)
  Process: 11563 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=1/FAILURE)
   CGroup: /system.slice/mysql.service
           ├─ 893 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/izm5ei6slp0lyg8ksv21xiz.pid
           └─1244 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/loca...

Apr 16 17:59:06 iZuf63x5aylgn2n11k2sllZ systemd[1]: Starting LSB: start and stop MySQL...
Apr 16 18:00:48 iZuf63x5aylgn2n11k2sllZ mysql[11563]: Starting MySQL.....................................................................................................T...).[FAILED]
Apr 16 18:00:48 iZuf63x5aylgn2n11k2sllZ systemd[1]: mysql.service: control process exited, code=exited status=1
Apr 16 18:00:48 iZuf63x5aylgn2n11k2sllZ systemd[1]: Failed to start LSB: start and stop MySQL.
Apr 16 18:00:48 iZuf63x5aylgn2n11k2sllZ systemd[1]: Unit mysql.service entered failed state.
Apr 16 18:00:48 iZuf63x5aylgn2n11k2sllZ systemd[1]: mysql.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

4:kill

[root@iZuf63x5aylgn2n11k2sllZ etc]# kill -9 893
[root@iZuf63x5aylgn2n11k2sllZ etc]# systemctl status mysql.service
● mysql.service - LSB: start and stop MySQL
   Loaded: loaded (/etc/rc.d/init.d/mysql; bad; vendor preset: disabled)
   Active: activating (start) since Tue 2019-04-16 18:15:17 CST; 38s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 10859 ExecStop=/etc/rc.d/init.d/mysql stop (code=exited, status=0/SUCCESS)
  Control: 12268 (mysql)
   CGroup: /system.slice/mysql.service
           ├─ 1244 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/loc...
           ├─12268 /bin/sh /etc/rc.d/init.d/mysql start
           ├─12276 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/iZuf63x5aylgn2n11k2sllZ.pid
           ├─12692 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/loc...
           └─12780 sleep 1

Apr 16 18:15:17 iZuf63x5aylgn2n11k2sllZ systemd[1]: Starting LSB: start and stop MySQL...
[root@iZuf63x5aylgn2n11k2sllZ etc]# kill -9 1244
[root@iZuf63x5aylgn2n11k2sllZ etc]# systemctl status mysql.service
● mysql.service - LSB: start and stop MySQL
   Loaded: loaded (/etc/rc.d/init.d/mysql; bad; vendor preset: disabled)
   Active: active (running) since Tue 2019-04-16 18:16:31 CST; 8s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 10859 ExecStop=/etc/rc.d/init.d/mysql stop (code=exited, status=0/SUCCESS)
  Process: 12268 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/mysql.service
           ├─12276 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/iZuf63x5aylgn2n11k2sllZ.pid
           └─12692 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/loc...

Apr 16 18:15:17 iZuf63x5aylgn2n11k2sllZ systemd[1]: Starting LSB: start and stop MySQL...
Apr 16 18:16:31 iZuf63x5aylgn2n11k2sllZ mysql[12268]: Starting MySQL.........................................................................[  OK  ]
Apr 16 18:16:31 iZuf63x5aylgn2n11k2sllZ systemd[1]: Started LSB: start and stop MySQL.
[root@iZuf63x5aylgn2n11k2sllZ etc]# 

5:new CMD

mysqladmin -uroot -p shutdown
netstat -lntp
systemctl restart mysql
netstat -lntp
systemctl status mysql.service

[root@iZuf6erqefu8ehonnqaibaZ ~]# mysqladmin -uroot -p shutdown
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
[root@iZuf6erqefu8ehonnqaibaZ ~]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN      27142/beam.smp      
tcp        0      0 0.0.0.0:8009            0.0.0.0:*               LISTEN      859/jsvc.exec       
tcp        0      0 0.0.0.0:6379            0.0.0.0:*               LISTEN      31229/src/redis-ser 
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      7495/nginx: master  
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      859/jsvc.exec       
tcp        0      0 0.0.0.0:4369            0.0.0.0:*               LISTEN      26999/epmd          
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1473/sshd           
tcp        0      0 0.0.0.0:15672           0.0.0.0:*               LISTEN      27142/beam.smp      
tcp        0      0 0.0.0.0:23000           0.0.0.0:*               LISTEN      29926/fdfs_storaged 
tcp        0      0 0.0.0.0:8888            0.0.0.0:*               LISTEN      7495/nginx: master  
tcp6       0      0 :::5672                 :::*                    LISTEN      27142/beam.smp      
tcp6       0      0 :::6379                 :::*                    LISTEN      31229/src/redis-ser 
tcp6       0      0 :::4369                 :::*                    LISTEN      26999/epmd          
[root@iZuf6erqefu8ehonnqaibaZ ~]# systemctl restart mysql
[root@iZuf6erqefu8ehonnqaibaZ ~]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN      27142/beam.smp      
tcp        0      0 0.0.0.0:8009            0.0.0.0:*               LISTEN      859/jsvc.exec       
tcp        0      0 0.0.0.0:6379            0.0.0.0:*               LISTEN      31229/src/redis-ser 
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      7495/nginx: master  
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      859/jsvc.exec       
tcp        0      0 0.0.0.0:4369            0.0.0.0:*               LISTEN      26999/epmd          
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1473/sshd           
tcp        0      0 0.0.0.0:15672           0.0.0.0:*               LISTEN      27142/beam.smp      
tcp        0      0 0.0.0.0:23000           0.0.0.0:*               LISTEN      29926/fdfs_storaged 
tcp        0      0 0.0.0.0:8888            0.0.0.0:*               LISTEN      7495/nginx: master  
tcp6       0      0 :::5672                 :::*                    LISTEN      27142/beam.smp      
tcp6       0      0 :::3306                 :::*                    LISTEN      31838/mysqld        
tcp6       0      0 :::6379                 :::*                    LISTEN      31229/src/redis-ser 
tcp6       0      0 :::4369                 :::*                    LISTEN      26999/epmd          
[root@iZuf6erqefu8ehonnqaibaZ ~]# systemctl status mysql.service
● mysql.service - LSB: start and stop MySQL
   Loaded: loaded (/etc/rc.d/init.d/mysql; bad; vendor preset: disabled)
   Active: active (running) since Wed 2019-04-17 00:15:17 CST; 4s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 31390 ExecStop=/etc/rc.d/init.d/mysql stop (code=exited, status=0/SUCCESS)
  Process: 31402 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/mysql.service
           ├─31410 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/iZuf6erqefu8ehonnqaibaZ.pid
           └─31838 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/lo...

Apr 17 00:15:16 iZuf6erqefu8ehonnqaibaZ systemd[1]: Starting LSB: start and stop MySQL...
Apr 17 00:15:17 iZuf6erqefu8ehonnqaibaZ mysql[31402]: Starting MySQL.[  OK  ]
Apr 17 00:15:17 iZuf6erqefu8ehonnqaibaZ systemd[1]: Started LSB: start and stop MySQL.
[root@iZuf6erqefu8ehonnqaibaZ ~]# 

 

你可能感兴趣的:(数据库)