Homebrew/legacy-homebrew

Can't run MariaDB at boot

zsien opened this issue · 4 comments

zsien commented

I want run MariaDB at boot (not at login). So I run sudo brew services start mariadb after installing MariaDB. But mariadb can't start.

This is the log file

160428 21:21:52 mysqld_safe mysqld from pid file /usr/local/var/mysql/Carlode-MBP.lan.pid ended
160428 21:22:02 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2016-04-28 21:22:03 140735141543936 [Note] /usr/local/Cellar/mariadb/10.1.13/bin/mysqld (mysqld 10.1.13-MariaDB) starting as process 37991 ...
2016-04-28 21:22:03 140735141543936 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2016-04-28 21:22:03 140735141543936 [ERROR] mysqld: File '/usr/local/var/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
2016-04-28 21:22:03 140735141543936 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/usr/local/var/mysql/aria_log_control'
2016-04-28 21:22:03 140735141543936 [ERROR] Plugin 'Aria' init function returned error.
2016-04-28 21:22:03 140735141543936 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2016-04-28 21:22:03 140735141543936 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-04-28 21:22:03 140735141543936 [Note] InnoDB: The InnoDB memory heap is disabled
2016-04-28 21:22:03 140735141543936 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-04-28 21:22:03 140735141543936 [Note] InnoDB: Memory barrier is not used
2016-04-28 21:22:03 140735141543936 [Note] InnoDB: Compressed tables use zlib 1.2.5
2016-04-28 21:22:03 140735141543936 [Note] InnoDB: Using SSE crc32 instructions
2016-04-28 21:22:03 140735141543936 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-04-28 21:22:03 140735141543936 [Note] InnoDB: Completed initialization of buffer pool
2016-04-28 21:22:03 140735141543936 [ERROR] InnoDB: ./ibdata1 can't be opened in read-write mode
2016-04-28 21:22:03 140735141543936 [ERROR] InnoDB: The system tablespace must be writable!
2016-04-28 21:22:03 140735141543936 [ERROR] Plugin 'InnoDB' init function returned error.
2016-04-28 21:22:03 140735141543936 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-04-28 21:22:03 140735141543936 [Note] Plugin 'FEEDBACK' is disabled.
2016-04-28 21:22:03 140735141543936 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2016-04-28 21:22:03 140735141543936 [ERROR] Unknown/unsupported storage engine: InnoDB
2016-04-28 21:22:03 140735141543936 [ERROR] Aborting

Sorry for my language!

zsien commented

I put

[mysqld]
user=carlo

to /usr/local/etc/my.cnf.d/user.cnf resolved the issue ...

zsien commented

And I change mariadb.rb line 151 to

system "sudo", "#{bin}/mysql_install_db", "--verbose", "--user=_mysql",
        "--basedir=#{prefix}", "--datadir=#{var}/mysql", "--tmpdir=/tmp"`

can resolved the issue too.

I think the most perfect way is running mariadb as _mysql user

All you need to do is change the permissions on the aria_log_control file.

See my answer, here

If this is still broken: we'll accept PRs for this but we're not actively working on it at this time.