【问题标题】:Can't start Mariadb properly?无法正常启动 Mariadb?
【发布时间】:2015-03-03 12:14:46
【问题描述】:

当我运行以下命令时:

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

我做错了什么?

【问题讨论】:

  • 除非你的 mysql 安装运行为 "dnsmasq":,否则你的文件的所有权是完全错误的。
  • 我已将所有内容更改为 mysql:mysql 但它不起作用。我得到了同样的ERROR] mysqld: Can't lock aria control file '/srv/dbs/mariadb/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds
  • “独家使用”?其他东西已经在使用它了吗?
  • 我通过删除 aria_log.00000001 和 aria_log_control 来解决错误消息。现在它工作正常。但我仍然不明白为什么在运行后:mysqld --defaults-file=/srv/configs/mariadb/my.cnf 终端挂起/冻结并扫描标准输入。无论我做什么都没有改变
  • @MarcB,你可以建议这个:delete aria_log.00000001, aria_log_control and make chown of all files to mysql:mysql 我接受你的回答!

标签: mysql database ubuntu permissions mariadb


【解决方案1】:

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

设置

SELINUX=disabled

在这个文件中

cat /etc/selinux/config

解决了我的问题。希望对您有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-05-16
    • 2018-08-30
    • 1970-01-01
    • 2017-05-07
    • 2021-04-11
    • 1970-01-01
    • 2019-04-16
    • 2018-03-30
    相关资源
    最近更新 更多