Reputation: 33
Unable to start mariadb.service. I'm getting following error while starting mariadb.service.
[root@localhost bggb]# systemctl start mariadb.service
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
Here is the status of mariadb.service
[root@localhost bggb]# systemctl status mariadb.service
● mariadb.service - MariaDB 10.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2021-07-12 16:56:03 IST; 59s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 6260 ExecStart=/usr/libexec/mysqld --basedir=/usr $MYSQLD_OPTS $_WSREP_NEW_CLUSTER (code=exited>
Process: 6221 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.service (code=exited, status=0/SUCC>
Process: 6196 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Main PID: 6260 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
Jul 12 16:56:03 localhost.localdomain mysqld[6260]: 2021-07-12 16:56:03 0 [ERROR] Plugin 'Aria' init funct>
Jul 12 16:56:03 localhost.localdomain mysqld[6260]: 2021-07-12 16:56:03 0 [ERROR] Plugin 'Aria' registrati>
Jul 12 16:56:03 localhost.localdomain mysqld[6260]: 2021-07-12 16:56:03 0 [Note] Plugin 'FEEDBACK' is disa>
Jul 12 16:56:03 localhost.localdomain mysqld[6260]: 2021-07-12 16:56:03 0 [ERROR] Could not open mysql.plu>
Jul 12 16:56:03 localhost.localdomain mysqld[6260]: 2021-07-12 16:56:03 0 [ERROR] Unknown/unsupported stor>
Jul 12 16:56:03 localhost.localdomain mysqld[6260]: 2021-07-12 16:56:03 0 [ERROR] Aborting
Jul 12 16:56:03 localhost.localdomain mysqld[6260]: Warning: Memory not freed: 520
Jul 12 16:56:03 localhost.localdomain systemd[1]: mariadb.service: Main process exited, code=exited, statu>
Jul 12 16:56:03 localhost.localdomain systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jul 12 16:56:03 localhost.localdomain systemd[1]: Failed to start MariaDB 10.3 database server.
Hear is the output of journalctl -xe for more information as requested. Configuration is done first time.
[root@localhost bggb]# journalctl -xe
Jul 12 17:45:52 localhost.localdomain org.gnome.Shell.desktop[2874]: == Stack trace for context 0x55df8c69>
Jul 12 17:45:52 localhost.localdomain org.gnome.Shell.desktop[2874]: #0 7ffd7797b5d0 b resource:///org>
Jul 12 17:45:52 localhost.localdomain org.gnome.Shell.desktop[2874]: #1 7ffd7797b680 b resource:///org>
Jul 12 17:45:52 localhost.localdomain org.gnome.Shell.desktop[2874]: #2 55df8cc77d30 i resource:///org>
Jul 12 17:45:52 localhost.localdomain org.gnome.Shell.desktop[2874]: #3 7ffd7797c610 b resource:///org>
Jul 12 17:45:52 localhost.localdomain gnome-shell[2874]: Object .Gjs_CapsLockWarning (0x55df8d192040), has>
Jul 12 17:45:52 localhost.localdomain org.gnome.Shell.desktop[2874]: #4 55df8cc77ca0 i resource:///org>
Jul 12 17:45:52 localhost.localdomain org.gnome.Shell.desktop[2874]: #5 55df8cc77c20 i resource:///org>
Jul 12 17:45:52 localhost.localdomain org.gnome.Shell.desktop[2874]: == Stack trace for context 0x55df8c69>
Jul 12 17:45:52 localhost.localdomain org.gnome.Shell.desktop[2874]: #0 7ffd7797b5d0 b resource:///org>
Jul 12 17:45:52 localhost.localdomain org.gnome.Shell.desktop[2874]: #1 7ffd7797b680 b resource:///org>
Jul 12 17:45:52 localhost.localdomain org.gnome.Shell.desktop[2874]: #2 55df8cc77d30 i resource:///org>
Jul 12 17:45:52 localhost.localdomain org.gnome.Shell.desktop[2874]: #3 7ffd7797c610 b resource:///org>
Jul 12 17:45:52 localhost.localdomain org.gnome.Shell.desktop[2874]: #4 55df8cc77ca0 i resource:///org>
Jul 12 17:45:52 localhost.localdomain org.gnome.Shell.desktop[2874]: #5 55df8cc77c20 i resource:///org>
Jul 12 17:45:52 localhost.localdomain gnome-shell[2874]: Object .Gjs_CapsLockWarning (0x55df8d192040), has>
Jul 12 17:45:53 localhost.localdomain NetworkManager[1115]: <info> [1626092153.0272] agent-manager: agent>
Jul 12 17:46:03 localhost.localdomain systemd[1]: fprintd.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- The unit fprintd.service has successfully entered the 'dead' state.
Upvotes: 3
Views: 44523
Reputation: 331
Renaming the log files and starting MySQL might be an option to fix this.
mv /var/lib/mysql/ib_logfile0 /var/lib/mysql/ib_logfile0.bak
mv /var/lib/mysql/ib_logfile1 /var/lib/mysql/ib_logfile1.bak
systemctl start mysql
Upvotes: 7
Reputation: 14666
It looks like the MariaDB datadir isn't writable. Check it is owned by the mysql
user along with the subdirectories:
chown -R mysql: /var/lib/mysql
If you have moved your datadir to somewhere under /home
, in addition to changing the permission above (with path corrected) disable the protection of ProtectHome in systemd with:
Run: systemctl edit mariadb.service
and include the following in the editor before saving and exiting:
[Service]
ProtectHome=false
Then restart the service:
systemctl restart mariadb.service
If you have changed the datadir from the default /var/lib/mysql
semanage fcontext -a -t mysqld_db_t "/mariadb/data(/.*)?"
restorecon -Rv /var/lib/mysql
It could be also that if your datadir is a freshly created filesystem it needs the right selinux labels:
restorecon -Rv /var/lib/mysql
For further information see the MariaDB selinux article Knowledge Base.
Upvotes: 2