简体   繁体   中英

mysql - Can't lock aria control file

I'm having problems with MariaDB, while it was first working fine. I only restarted the server, when I couldn't start the MySQL daemon anymore. It seems to still be using my old USB-stick's file path (/media/brood), while I already switched over to a new HDD instead (/media/seagate). This is the error I'm getting in /var/log/mysql/error.log:

160728  9:32:32 [ERROR] mysqld: Can't lock aria control file '/media/brood/mysql/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds
160728  9:33:03 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/media/brood/mysql/aria_log_control'
160728  9:33:03 [ERROR] Plugin 'Aria' init function returned error.
160728  9:33:03 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
160728  9:33:03 [Note] InnoDB: Using mutexes to ref count buffer pool pages
160728  9:33:03 [Note] InnoDB: The InnoDB memory heap is disabled
160728  9:33:03 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
160728  9:33:03 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
160728  9:33:03 [Note] InnoDB: Compressed tables use zlib 1.2.8
160728  9:33:03 [Note] InnoDB: Using Linux native AIO
160728  9:33:03 [Note] InnoDB: Not using CPU crc32 instructions
160728  9:33:03 [Note] InnoDB: Initializing buffer pool, size = 128.0M
160728  9:33:03 [Note] InnoDB: Completed initialization of buffer pool
160728  9:33:03 [ERROR] InnoDB: Unable to lock ./ib_logfile0, error: 11
160728  9:33:03 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
160728  9:33:03 [ERROR] InnoDB: Unable to open './ib_logfile0'
160728  9:33:03 [ERROR] Plugin 'InnoDB' init function returned error.
160728  9:33:03 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160728  9:33:03 [Note] Plugin 'FEEDBACK' is disabled.
mysqld: Too many arguments (first extra is 'stop').
160728  9:33:03 [ERROR] Aborting

160728  9:33:03 [Note] mysqld: Shutdown complete

It could also be permission issues, or maybe files are still locked (I don't know how that works), because the last time the Raspberry Pi restarted, it was because someone accidentally pulled out the power plug of the Pi.

Why the log contained the path to the old mysql data folder is still a mystery to me. (It's not even the previous USB-stick, to make the story more complete, it's actually the USB-stick I used before that!) But, the problem is solved! The answer was actually much simpler than I thought, it turns out, my brother uninstalled something (an emulator for playing old games, he said), when he noticed it uninstalled mariadb-server-10.0 (strange!). So I did a simple sudo apt-get install mariadb-server-10.0 , and guess what! It solved my problem! :D

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM