当我运行以下命令时:

mysqld --defaults-file=/srv/configs/mariadb/my.cnf


我得到如下:

150105 21:05:29 [ERROR] mysqld: Can't lock aria control file '/srv/dbs/mariadb/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds
150105 21:05:52 [Note] InnoDB: Using mutexes to ref count buffer pool pages
150105 21:05:52 [Note] InnoDB: The InnoDB memory heap is disabled
150105 21:05:52 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
150105 21:05:52 [Note] InnoDB: Memory barrier is not used
150105 21:05:52 [Note] InnoDB: Compressed tables use zlib 1.2.8
150105 21:05:52 [Note] InnoDB: Using Linux native AIO
150105 21:05:52 [Note] InnoDB: Using CPU crc32 instructions
150105 21:05:52 [Note] InnoDB: Initializing buffer pool, size = 128.0M
150105 21:05:52 [Note] InnoDB: Completed initialization of buffer pool
150105 21:05:52 [Note] InnoDB: Highest supported file format is Barracuda.
150105 21:05:52 [Note] InnoDB: 128 rollback segment(s) are active.
150105 21:05:52 [Note] InnoDB: Waiting for purge to start
150105 21:05:52 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.21-70.0 started; log sequence number 1616961
150105 21:05:52 [Note] Plugin 'FEEDBACK' is disabled.
150105 21:05:52 [Note] Server socket created on IP: '0.0.0.0'.
150105 21:05:52 [Note] Event Scheduler: Loaded 0 events
150105 21:05:52 [Note] WSREP: Read nil XID from storage engines, skipping position init
150105 21:05:52 [Note] WSREP: wsrep_load(): loading provider library 'none'
150105 21:05:52 [Note] mysqld: ready for connections.
Version: '10.1.2-MariaDB-1~trusty-wsrep'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution, wsrep_25.10.r4123


此时,终端会挂起,只有Ctrl + Z可以通过将此过程发送到后台来工作。

一些有用的信息如何显示我的自定义目录用于存储数据库。看起来应该有一些mysql:mysql拥有的文件:

-rw-rw---- 1 dnsmasq systemd-journal    16384 янв.   6 00:05 aria_log.00000001
-rw-rw---- 1 dnsmasq systemd-journal       52 янв.   6 00:05 aria_log_control
drwx------ 2 dnsmasq systemd-journal     4096 янв.   5 23:17 bla
-rw-r--r-- 1 root    root                   0 янв.   4 21:51 debian-10.1.flag
-rw-rw---- 1 dnsmasq systemd-journal 12582912 янв.   6 00:10 ibdata1
-rw-rw---- 1 dnsmasq systemd-journal 50331648 янв.   6 00:10 ib_logfile0
-rw-rw---- 1 dnsmasq systemd-journal 50331648 янв.   4 21:51 ib_logfile1
-rw-rw---- 1 dnsmasq systemd-journal        0 янв.   5 19:05 multi-master.info
drwxr-xr-x 2 dnsmasq root                4096 янв.   5 19:05 mysql
-rw------- 1 root    root                  14 янв.   5 19:05 mysql_upgrade_info
drwx------ 2 dnsmasq systemd-journal     4096 янв.   5 19:05 performance_schema
-rw-rw---- 1 dnsmasq systemd-journal    24576 янв.   6 00:10 tc.log
drwx------ 2 dnsmasq systemd-journal     4096 янв.   5 19:27 testo


我怎么了

最佳答案

我为类似的问题困扰了几天。通过将内存从512MB增加到至少1GB解决了我的问题(尽管您的问题似乎与内存无关)。
我建议检查是否启用了SELinux。默认情况下,这是在新的CentOS 7服务器上执行的。

设置

SELINUX=disabled


在这个文件中

cat /etc/selinux/config


解决了我的问题。希望能帮助到你。

09-04 09:31
查看更多