-1

I'm trying to get mariadb 10.2/10.3 to work on a fresh installation of ubuntu server 6.04 which comes with mysql 5.7. The installation process goes fine and everything works fine untill I reboot the system, then mariadb service won't start anymore returning a timeout error

Job for mariadb.service failed because a timeout was exceeded. See "systemctl status mariadb.service" and "journalctl -xe" for details

systemctl status returns:

mariadb.service - MariaDB 10.2.20 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/mariadb.service.d
         migrated-from-my.cnf-settings.conf
Active: failed (Result: timeout) Since Mon 2019-05-13 18:04:28 CEST; 46s ago
Docs: man:mysqld(8)
      https://mariadb.com/kb/en/library/systemd/
Process: 1922 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 1909 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery && VAR = ||  VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]  && systemctl set-enviroment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 1901 ExecStartPre=/bin/sh -c systemctl unset-enviroment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process 1898 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
MainPID: 1922 (code=exited, status=0/SUCCESS)

ubuntu mysqld[1922]: [Note] Event Scheduler: Purging the queue. 0 events
ubuntu mysqld[1922]: [Note] InnoDB: Starting shutdown
ubuntu mysqld[1922]: [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
ubuntu mysqld[1922]: [Note] InnoDB: Buffer pool(s) to /var/lib/mysqld/ib_buffer_pool
ubuntu mysqld[1922]: [Note] InnoDB: Shutdown completed; log sequence number 3074612
    ubuntu mysqld[1922]: [Note] InnoDB:Removed temporary tablespace data file "ibtmp1"
    ubuntu mysqld[1922]: [Note] /usr/sbin/mysqld: Shutdown complete
ubuntu systemd[1]: Failed to start MariaDB 10.2.20 database server
ubuntu systemd[1]: mariadb.service: Unit entered failed state.
ubuntu systemd[1]: mariadb.service: Failed with result 'timeout'.

journalctl -xe returns a lot of

AVC apparmor="DENIED" operation="open" or with operation="sendmsg"
  • There will likely be a mariadb.log file somewhere on your system that will have a cleaner version of the logs you should read. Failing that, learn how to filter teh journal to show only the log entries that you need. – user9517 May 14 at 9:51
  • 1
    Learn about apparmor -- it is preventing some actions. – Rick James May 14 at 14:31
0

Here are some of the contents of /etc/apparmor.d/usr.sbin.mysqld change your directories respectively.

# vim:syntax=apparmor
# Last Modified: Tue Jun 19 17:37:30 2007
#include <tunables/global>
/usr/sbin/mysqld {
  #include <abstractions/base>
...  
  /var/log/mysql.err rw,
  /var/lib/mysql/ r,
  /var/lib/mysql/** rwk,
  /var/log/mysql/ r,
  /var/log/mysql/* rw,
...  
  # Site-specific additions and overrides. See local/README for details.
  #include <local/usr.sbin.mysqld>
}

reload apparmor service

$sudo service apparmor reload

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.