【mysql异常】 InnoDB: Check that you do not already have another mysqld process using the same InnoDB da

本文主要介绍了MySQL出现异常的两种常见情况及解决办法。一种是由于磁盘空间不足导致的问题,可以通过检查磁盘剩余空间来判断;另一种是重启MySQL时未正确关闭相关进程,需要通过查找并终止相关进程后再尝试重启。

mysql异常

出现该异常的原因一般有两个,一个是磁盘空间不足,检查磁盘剩余空间

df -h

另一个原因,就是mysql重启时,没有将相关进程杀死,导致重启时,有其他进程在读取文件,解决办法:

找到相关进程:

ps aux |grep mysql*

全部杀死后,再次重启mysql成功!

[root@master mysql]# [root@master mysql]# cat /export/server/mysql/data/error.log 2025-10-23T01:13:55.414279Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2025-10-23T01:13:55.414408Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 2025-10-23T01:13:55.414450Z 0 [Note] /export/server/mysql/bin/mysqld (mysqld 5.7.43) starting as process 75223 ... 2025-10-23T01:13:55.420835Z 0 [Note] InnoDB: PUNCH HOLE support available 2025-10-23T01:13:55.420908Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2025-10-23T01:13:55.420916Z 0 [Note] InnoDB: Uses event mutexes 2025-10-23T01:13:55.420919Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier 2025-10-23T01:13:55.420922Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.13 2025-10-23T01:13:55.420925Z 0 [Note] InnoDB: Using Linux native AIO 2025-10-23T01:13:55.421185Z 0 [Note] InnoDB: Number of pools: 1 2025-10-23T01:13:55.421275Z 0 [Note] InnoDB: Using CPU crc32 instructions 2025-10-23T01:13:55.435005Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 2025-10-23T01:13:55.444667Z 0 [Note] InnoDB: Completed initialization of buffer pool 2025-10-23T01:13:55.450205Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). 2025-10-23T01:13:55.463031Z 0 [Note] InnoDB: Highest supported file format is Barracuda. 2025-10-23T01:13:55.473691Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2025-10-23T01:13:55.473830Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 2025-10-23T01:13:55.495089Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. 2025-10-23T01:13:55.495883Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. 2025-10-23T01:13:55.496011Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. 2025-10-23T01:13:55.496616Z 0 [Note] InnoDB: Waiting for purge to start 2025-10-23T01:13:55.547361Z 0 [Note] InnoDB: 5.7.43 started; log sequence number 2766921 2025-10-23T01:13:55.549046Z 0 [Note] InnoDB: Loading buffer pool(s) from /export/server/mysql/data/ib_buffer_pool 2025-10-23T01:13:55.549951Z 0 [Note] Plugin 'FEDERATED' is disabled. 2025-10-23T01:13:55.551197Z 0 [Note] InnoDB: Buffer pool(s) load completed at 251023 9:13:55 2025-10-23T01:13:55.556296Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them. 2025-10-23T01:13:55.556312Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory. 2025-10-23T01:13:55.556317Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher. 2025-10-23T01:13:55.556320Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher. 2025-10-23T01:13:55.560623Z 0 [Warning] CA certificate ca.pem is self signed. 2025-10-23T01:13:55.560676Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory. 2025-10-23T01:13:55.561456Z 0 [Note] Server hostname (bind-address): '*'; port: 3306 2025-10-23T01:13:55.561525Z 0 [Note] IPv6 is available. 2025-10-23T01:13:55.561533Z 0 [Note] - '::' resolves to '::'; 2025-10-23T01:13:55.561553Z 0 [Note] Server socket created on IP: '::'. 2025-10-23T01:13:55.572947Z 0 [Note] Event Scheduler: Loaded 0 events 2025-10-23T01:13:55.573171Z 0 [Note] /export/server/mysql/bin/mysqld: ready for connections. Version: '5.7.43' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL) 2025-10-23T01:14:34.896537Z 2 [Note] Access denied for user 'root'@'localhost' (using password: YES) 2025-10-23T01:38:33.169627Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2025-10-23T01:38:33.169753Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 2025-10-23T01:38:33.169798Z 0 [Note] /export/server/mysql/bin/mysqld (mysqld 5.7.43) starting as process 118444 ... 2025-10-23T01:38:33.177313Z 0 [Note] InnoDB: PUNCH HOLE support available 2025-10-23T01:38:33.177351Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2025-10-23T01:38:33.177357Z 0 [Note] InnoDB: Uses event mutexes 2025-10-23T01:38:33.177361Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier 2025-10-23T01:38:33.177364Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.13 2025-10-23T01:38:33.177367Z 0 [Note] InnoDB: Using Linux native AIO 2025-10-23T01:38:33.177700Z 0 [Note] InnoDB: Number of pools: 1 2025-10-23T01:38:33.178030Z 0 [Note] InnoDB: Using CPU crc32 instructions 2025-10-23T01:38:33.182715Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 2025-10-23T01:38:33.192178Z 0 [Note] InnoDB: Completed initialization of buffer pool 2025-10-23T01:38:33.194675Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). 2025-10-23T01:38:33.204980Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:33.205030Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:33.205040Z 0 [Note] InnoDB: Retrying to lock the first data file 2025-10-23T01:38:34.206008Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:34.206060Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:35.206300Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:35.206348Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:36.206929Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:36.206965Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:37.207044Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:37.207082Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:38.207378Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:38.207423Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:39.207891Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:39.207968Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:40.208356Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:40.208493Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:41.209159Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:41.209210Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:42.209436Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:42.209466Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:43.222502Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:43.222576Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:44.223360Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:44.223423Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:45.223766Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:45.223802Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:46.224017Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:46.224080Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:47.224624Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:47.224687Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:48.224825Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:48.224865Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:49.225531Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:49.225584Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:50.225762Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:50.225826Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:51.226964Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:51.227011Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:52.227384Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:52.227425Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:53.227939Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:53.227989Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:54.228400Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:54.228452Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:55.228603Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:55.228636Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:56.229104Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:56.229169Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:57.229819Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:57.229876Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:58.230309Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:58.230365Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:38:59.230752Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:38:59.230806Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:00.231287Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:00.231348Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:01.232308Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:01.232384Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:02.232711Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:02.232767Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:03.233423Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:03.233489Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:04.233976Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:04.234016Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:05.234460Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:05.234513Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:06.234802Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:06.234869Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:07.235875Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:07.235955Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:08.236527Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:08.236589Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:09.237178Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:09.237244Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:10.237935Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:10.238204Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:11.238609Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:11.238711Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:12.239379Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:12.239434Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:13.239799Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:13.239851Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:14.240048Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:14.240108Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:15.240305Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:15.240360Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:16.240582Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:16.240638Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:17.241380Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:17.241418Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:18.242303Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:18.242439Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:19.243096Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:19.243153Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:20.243484Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:20.243556Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:21.243759Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:21.243809Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:22.244131Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:22.244186Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:23.244922Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:23.245052Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:24.246341Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:24.246388Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:25.246626Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:25.246675Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:26.247096Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:26.248258Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:27.248681Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:27.248748Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:28.249386Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:28.249439Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:29.249626Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:29.249667Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:30.249910Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:30.249963Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:31.251042Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:31.251083Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:32.251255Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:32.251299Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:33.251726Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:33.251777Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:34.251973Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:34.252030Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:35.252544Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:35.252592Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:36.252876Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:36.252931Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:37.253711Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:37.253768Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:38.253946Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:38.253991Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:39.254333Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:39.254390Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:40.254700Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:40.254765Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:41.255174Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:41.255238Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:42.255552Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:42.255628Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:43.256063Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:43.256124Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:44.256363Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:44.256418Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:45.257169Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:45.257245Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:46.257802Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:46.257874Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:47.258303Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:47.258358Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:48.258913Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:48.258968Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:49.259298Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:49.259355Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:50.259563Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:50.259631Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:51.259846Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:51.259902Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:52.260069Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:52.260123Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:53.260689Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:53.260743Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:54.261138Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:54.261195Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:55.261401Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:55.261458Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:56.261669Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:56.261722Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:57.262101Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:57.262154Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:58.262590Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:58.262646Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:39:59.263205Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:39:59.263261Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:40:00.263719Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:40:00.263776Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:40:01.263992Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:40:01.264027Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:40:02.264200Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:40:02.264249Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:40:03.264605Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:40:03.264675Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:40:04.265198Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:40:04.265244Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:40:05.265605Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:40:05.265713Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:40:06.265930Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:40:06.265987Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:40:07.266540Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:40:07.266604Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:40:08.267198Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:40:08.267254Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:40:09.267931Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:40:09.268002Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:40:10.268330Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:40:10.268373Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:40:11.268930Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:40:11.268982Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:40:12.269604Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:40:12.269658Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:40:13.269932Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 2025-10-23T01:40:13.269980Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files. 2025-10-23T01:40:13.269985Z 0 [Note] InnoDB: Unable to open the first data file 2025-10-23T01:40:13.270007Z 0 [ERROR] InnoDB: Operating system error number 11 in a file operation. 2025-10-23T01:40:13.270028Z 0 [ERROR] InnoDB: Error number 11 means 'Resource temporarily unavailable' 2025-10-23T01:40:13.270034Z 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 2025-10-23T01:40:13.270038Z 0 [ERROR] InnoDB: Cannot open datafile './ibdata1' 2025-10-23T01:40:13.270045Z 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! 2025-10-23T01:40:13.270059Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Cannot open a file 2025-10-23T01:40:13.470950Z 0 [ERROR] Plugin 'InnoDB' init function returned error. 2025-10-23T01:40:13.470999Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2025-10-23T01:40:13.471006Z 0 [ERROR] Failed to initialize builtin plugins. 2025-10-23T01:40:13.471008Z 0 [ERROR] Aborting 2025-10-23T01:40:13.471026Z 0 [Note] Binlog end 2025-10-23T01:40:13.471098Z 0 [Note] Shutting down plugin 'MyISAM' 2025-10-23T01:40:13.471480Z 0 [Note] /export/server/mysql/bin/mysqld: Shutdown complete [root@master mysql]#
最新发布
10-24
```markdown ### 文件类型判断 该文件为 **“普通文本型”**,内容是用户在尝试启动 MySQL 服务时产生的完整错误日志输出,核心问题是: > **InnoDB: Unable to lock ./ibdata1 error: 11** 这是一个典型的 **MySQL 启动失败故障排查请求**,需基于日志进行精准诊断与修复。 --- ## 🔍 错误根源分析 从您提供的 `error.log` 中可以明确看到以下关键信息: ``` [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11 [ERROR] InnoDB: Operating system error number 11 in a file operation. [ERROR] InnoDB: Error number 11 means 'Resource temporarily unavailable' [ERROR] InnoDB: Cannot open datafile './ibdata1' [ERROR] InnoDB: Could not open or create the system tablespace. ... [ERROR] Plugin 'InnoDB' init function returned error. [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. [ERROR] Aborting ``` ### ✅ 核心结论: **MySQL 无法锁定 `ibdata1` 文件,原因:已有另一个 `mysqld` 进程正在使用该数据文件!** 错误码 `11 (EAGAIN / Resource temporarily unavailable)` 表示资源被占用或并发访问冲突。 --- # 🛠️ 解决方案:终止残留进程并重启服务 --- ## 第一步:查找并杀死正在运行的 mysqld 进程 执行命令查看是否有已存在的 MySQL 进程: ```bash ps aux | grep mysqld ``` 输出可能类似: ``` ma 75223 0.0 5.2 1203840 53948 ? Sl 01:13 0:00 /export/server/mysql/bin/mysqld --user=mysql ... ma 118444 0.0 0.1 123456 789 ? S 01:38 0:00 grep mysqld ``` 👉 记下第一个进程 ID(如 `75223`),它是卡住的旧实例。 强制终止该进程: ```bash sudo kill -9 75223 ``` > ⚠️ 替换为你实际查到的 PID! --- ## 第二步:确认端口 3306 是否被占用 ```bash netstat -tulnp | grep 3306 ``` 如果仍有占用: ```bash sudo pkill mysqld # 或 sudo lsof -i :3306 sudo kill -9 <PID> ``` --- ## 第三步:删除残留的 PID 文件和 Socket 文件 有时旧进程未清理临时文件: ```bash sudo rm -f /export/server/mysql/mysql.pid sudo rm -f /tmp/mysql.sock ``` --- ## 第四步:修复数据目录权限 确保 `mysql` 用户对数据目录有完全控制权: ```bash sudo chown -R mysql:mysql /export/server/mysql/data sudo chmod -R 755 /export/server/mysql/data ``` --- ## 第五步:修改 `/etc/init.d/mysql` 脚本中的运行用户 编辑服务脚本: ```bash sudo vi /etc/init.d/mysql ``` 找到这一行: ```bash user="root" ``` 改为: ```bash user="mysql" ``` ✅ 保存退出。 否则即使你用 `service mysql start`,也会以 `root` 身份启动,导致与数据文件权限冲突。 --- ## 第六步:重新启动 MySQL 服务 ```bash sudo service mysql start ``` 检查状态: ```bash ps aux | grep mysqld netstat -tulnp | grep 3306 ``` 应看到新进程正常运行。 --- ## 第七步:验证是否能登录 ```bash /export/server/mysql/bin/mysql -u root -p ``` 输入你的密码(初始为初始化时生成的临时密码,或你设置的 `123456`)。 若成功进入 MySQL 命令行,则说明问题已解决! --- # ✅ 预防措施建议 | 措施 | 说明 | |------|------| | ❌ 不要用 `root` 启动 mysqld | 应使用专用 `mysql` 用户避免权限混乱 | | ✅ 使用 `service mysql stop` 正常关闭 | 避免直接 `kill -9` 导致数据损坏 | | ✅ 定期检查日志 | `/export/server/mysql/data/error.log` 是第一手排错依据 | --- # 📚 知识点详解(不超过三项) ### 1. InnoDB 系统表空间(ibdata1) 存储数据字典、undo日志等核心信息,MySQL启动时必须能独占访问,否则报错无法启动。 ### 2. 错误码 11(EAGAIN) 表示“资源暂时不可用”,在文件锁竞争中常见,多因另一进程已持有锁导致。 ### 3. my.cnf 中 user 配置 指定 mysqld 运行身份,必须与数据目录所属用户一致,否则出现权限拒绝问题。 --- 🎉 **恭喜!你现在应该已经解决了 MySQL 因 ibdata1 锁定失败的问题。** 接下来可继续配置 Hive 元数据库初始化: ```bash cd /export/server/hive bin/schematool -initSchema -dbType mysql -verbose ``` 如有其他问题,请随时贴出日志,我会持续协助您完成部署! ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

帅胖子

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值