Gelöst: MariaDB – aria_log_control (Errcode: 13 „Permission denied“)

Das Problem:

Einige Zeit nach der Migration von MySQL auf MariaDB hagelte es immer wieder Probleme. Das neueste war „Errcode 13: Pemission denied“. Diese Fehlermeldung ist derart verwirrend, zumal dieses nicht (auf den ersten Blick) zutraf. Die Datei aria_log_control war sehr wohl beschreib- / lösch-  und änderbar. Eine stundenlange Recherce in diversen Foren, Mailinglists und Bugtracking Systemen blieb genauso erfolglich wie eine komplette Deinstallation und Neuinstallation von MariaDB, der Fehler hielt sich hartnäckig. 🙄

Die Lösung:

Wie so oft ist die Lösung eines Problems simpel, wenn wann diese kennt. In meinem Fall lag es schlichtweg daran, dass das „datadir“ ein Symlink war. Das Originalverzeichnis befand sich u.a. aus Backupgründen unter:  ~/Library/MySQL und ich habe es symbolisch verlinkt zu /usr/local/var/mysql. Ich sah darin kein Proble, zumal wie seine Vorgänger auch Mac OSX 10.10 „Yosemite“ ein auf Unix basiertes Betriebssystem ist, welches schon seit grauer Urzeit mit Symlinks umgehen kann. Aber offenbar ist in dem „Aria Plugin“ von MariaDB irgend etwas drin, was „echten“, unverlinkten Zugriff auf aria_log_control benötigt, was immer das auch sein mag. Jetzt nachdem ich ~/Library/MySQL  direkt zu /usr/local/var/mysql verschoben habe, schnurrt MariaDB endlich wie ein Kätzchen.

Der Fehlerstack beim einem Symlink im Pfad zum „datadir“:

mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
[Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
[ERROR] mysqld: Can't create/write to file '/usr/local/var/mysql/aria_log_control' (Errcode: 13 "Permission denied")
[ERROR] mysqld: Got error 'Can't create file' when trying to use aria control file '/usr/local/var/mysql/aria_log_control'
[ERROR] Plugin 'Aria' init function returned error.
[ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
[Note] InnoDB: Using mutexes to ref count buffer pool pages
[Note] InnoDB: The InnoDB memory heap is disabled
[Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
[Note] InnoDB: Memory barrier is not used
[Note] InnoDB: Compressed tables use zlib 1.2.5
[Note] InnoDB: Using CPU crc32 instructions
[Note] InnoDB: Initializing buffer pool, size = 128.0M
[Note] InnoDB: Completed initialization of buffer pool
[Note] InnoDB: Highest supported file format is Barracuda.
[Note] InnoDB: 128 rollback segment(s) are active.
[Note] InnoDB: Waiting for purge to start
[Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.20-68.0 started; log sequence number 4542056798
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
[ERROR] Aria engine is not enabled or did not start. The Aria engine must be enabled to continue as mysqld was configured with --with-aria-tmp-tables
[ERROR] Aborting

[Note] InnoDB: FTS optimize thread exiting.
[Note] InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number 4542056808
[Note] /usr/local/Cellar/mariadb/10.0.14_1/bin/mysqld: Shutdown complete