我刚刚在一台干净的 Debian 7 机器上安装了 MariaDB。当我想要运行时mysql_install_db
,我收到以下错误:
150329 18:01:27 [Note] InnoDB: Using mutexes to ref count buffer pool pages
150329 18:01:27 [Note] InnoDB: The InnoDB memory heap is disabled
150329 18:01:27 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
150329 18:01:27 [Note] InnoDB: Memory barrier is not used
150329 18:01:27 [Note] InnoDB: Compressed tables use zlib 1.2.7
150329 18:01:27 [Note] InnoDB: Using Linux native AIO
150329 18:01:27 [Note] InnoDB: Using CPU crc32 instructions
150329 18:01:27 [Note] InnoDB: Initializing buffer pool, size = 256.0M
150329 18:01:27 [Note] InnoDB: Completed initialization of buffer pool
150329 18:01:27 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
150329 18:01:27 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
150329 18:01:27 [Note] InnoDB: Retrying to lock the first data file
150329 18:01:28 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Error number 11 means 'Resource temporarily unavailable'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
150329 18:03:07 [ERROR] InnoDB: Can't open './ibdata1'
150329 18:03:07 [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!
150329 18:03:07 [ERROR] Plugin 'InnoDB' init function returned error.
150329 18:03:07 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150329 18:03:07 [ERROR] mysqld: Can't lock aria control file '/var/lib/mysql/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds
150329 18:03:38 [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 '/var/lib/mysql/aria_log_control'
150329 18:03:38 [ERROR] Plugin 'Aria' init function returned error.
150329 18:03:38 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
150329 18:03:38 [ERROR] Unknown/unsupported storage engine: InnoDB
150329 18:03:38 [ERROR] Aborting
150329 18:03:38 [Note] /usr/sbin/mysqld: Shutdown complete
我查看了错误 11,根据 MySQL 5.6 文档,它表示“EAGAIN”。我不确定为什么 MariaDB 没有解释这一点,因为我不知道下一步该怎么做。谁能帮帮我?
答案1
MariaDB 已在运行(因为 Debian 为您启动并运行了mysql_install_db
它)。
答案2
我想到两种问题:
还有另一个 mysqld 实例正在运行。
检查
ps -ef | grep mysqld
您有权限问题。您的用户没有权限写入数据库文件。请检查
./ibdata1
文件的权限。