You are not logged in.

#1 2019-09-29 03:16:29

arh85
Member
Registered: 2019-09-29
Posts: 2

[SOLVED] Unable to start mariadb.service

Hi All,

I have installed mariadb according to the Wiki but when I try and start the service I get the below error

[alan@archvb ~]$ sudo systemctl start mariadb
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

sudo systemctl status mariadb.service

● mariadb.service - MariaDB 10.4.8 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2019-09-29 12:52:46 AEST; 6min ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 10120 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 10121 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_S>
  Process: 10129 ExecStart=/usr/bin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
 Main PID: 10129 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"

Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] Server socket created on IP: '::'.
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: Buffer pool(s) load completed at 190929 12:52:44
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.db' doesn't exist
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [ERROR] Aborting
Sep 29 12:52:46 archvb systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Sep 29 12:52:46 archvb systemd[1]: mariadb.service: Failed with result 'exit-code'.
Sep 29 12:52:46 archvb systemd[1]: Failed to start MariaDB 10.4.8 database server.

sudo journalctl -xe

Sep 29 12:53:58 archvb rtkit-daemon[640]: Supervising 16 threads of 8 processes of 1 users.
Sep 29 12:53:58 archvb rtkit-daemon[640]: Supervising 16 threads of 8 processes of 1 users.
Sep 29 12:53:58 archvb rtkit-daemon[640]: Supervising 16 threads of 8 processes of 1 users.
Sep 29 12:53:58 archvb rtkit-daemon[640]: Successfully made thread 10220 of process 10200 owned by '1000' RT at priority 10.
Sep 29 12:53:58 archvb rtkit-daemon[640]: Supervising 17 threads of 9 processes of 1 users.
Sep 29 12:53:58 archvb rtkit-daemon[640]: Supervising 17 threads of 9 processes of 1 users.
Sep 29 12:53:58 archvb rtkit-daemon[640]: Successfully made thread 10221 of process 10200 owned by '1000' RT at priority 10.
Sep 29 12:53:58 archvb rtkit-daemon[640]: Supervising 18 threads of 9 processes of 1 users.
Sep 29 12:54:00 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce short: offset negative (-6ms)
Sep 29 12:54:38 archvb rtkit-daemon[640]: Supervising 18 threads of 9 processes of 1 users.
Sep 29 12:54:38 archvb rtkit-daemon[640]: Supervising 18 threads of 9 processes of 1 users.
Sep 29 12:54:38 archvb rtkit-daemon[640]: Supervising 18 threads of 9 processes of 1 users.
Sep 29 12:54:38 archvb rtkit-daemon[640]: Successfully made thread 10255 of process 10235 owned by '1000' RT at priority 10.
Sep 29 12:54:38 archvb rtkit-daemon[640]: Supervising 19 threads of 10 processes of 1 users.
Sep 29 12:54:38 archvb rtkit-daemon[640]: Supervising 19 threads of 10 processes of 1 users.
Sep 29 12:54:38 archvb rtkit-daemon[640]: Successfully made thread 10254 of process 10235 owned by '1000' RT at priority 10.
Sep 29 12:54:38 archvb rtkit-daemon[640]: Supervising 20 threads of 10 processes of 1 users.
Sep 29 12:55:06 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce: offset negative (-25ms)
Sep 29 12:55:06 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce short: offset negative (-39ms)
Sep 29 12:55:35 archvb sudo[10270]:     alan : TTY=pts/1 ; PWD=/home/alan ; USER=root ; COMMAND=/usr/bin/pacman -R mariadb-server
Sep 29 12:55:35 archvb sudo[10270]: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep 29 12:55:35 archvb sudo[10270]: pam_unix(sudo:session): session closed for user root
Sep 29 12:55:45 archvb sudo[10273]:     alan : TTY=pts/1 ; PWD=/home/alan ; USER=root ; COMMAND=/usr/bin/pacman -S mariadb-server
Sep 29 12:55:45 archvb sudo[10273]: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep 29 12:55:45 archvb sudo[10273]: pam_unix(sudo:session): session closed for user root
Sep 29 12:56:42 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce: offset negative (-25ms)
Sep 29 12:57:51 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce short: offset negative (-3ms)
Sep 29 12:57:53 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce: offset negative (-24ms)
Sep 29 12:57:53 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce: offset negative (-37ms)
Sep 29 12:57:53 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce short: offset negative (-50ms)
Sep 29 12:58:41 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce: offset negative (-19ms)
Sep 29 12:58:41 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce short: offset negative (-32ms)
Sep 29 12:58:54 archvb sudo[10298]:     alan : TTY=pts/1 ; PWD=/home/alan ; USER=root ; COMMAND=/usr/bin/systemctl status mariadb.service
Sep 29 12:58:54 archvb sudo[10298]: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep 29 12:59:16 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce: offset negative (-7ms)
Sep 29 12:59:16 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce short: offset negative (-20ms)
Sep 29 12:59:19 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce: offset negative (-22ms)
Sep 29 12:59:19 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce short: offset negative (-35ms)
Sep 29 13:00:07 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce: offset negative (-19ms)
Sep 29 13:00:07 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce short: offset negative (-32ms)
Sep 29 13:00:09 archvb sudo[10298]: pam_unix(sudo:session): session closed for user root
Sep 29 13:00:19 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce short: offset negative (-10ms)
Sep 29 13:00:51 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce: offset negative (-25ms)
Sep 29 13:00:51 archvb org.gnome.Shell.desktop[754]: libinput error: client bug: timer event7 debounce short: offset negative (-38ms)
Sep 29 13:01:25 archvb sudo[10322]:     alan : TTY=pts/1 ; PWD=/home/alan ; USER=root ; COMMAND=/usr/bin/journalctl -xe
Sep 29 13:01:25 archvb sudo[10322]: pam_unix(sudo:session): session opened for user root by (uid=0)

sudo journalctl _PID=10129

-- Logs begin at Sat 2019-09-14 16:38:02 AEST, end at Sun 2019-09-29 13:06:58 AEST. --
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] /usr/bin/mysqld (mysqld 10.4.8-MariaDB) starting as process 10129 ...
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: Using Linux native AIO
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: Uses event mutexes
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: Number of pools: 1
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: Using SSE2 crc32 instructions
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: Completed initialization of buffer pool
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the >
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: Creating shared tablespace for temporary tables
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: Waiting for purge to start
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: 10.4.8 started; log sequence number 113856; transaction id 9
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] Server socket created on IP: '::'.
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [Note] InnoDB: Buffer pool(s) load completed at 190929 12:52:44
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.db' doesn't exist
Sep 29 12:52:44 archvb mysqld[10129]: 2019-09-29 12:52:44 0 [ERROR] Aborting
# /usr/lib/systemd/system/mariadb.service
#
# /etc/systemd/system/mariadb.service
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Thanks to:
# Daniel Black
# Erkan Yanar
# David Strauss
# and probably others

[Unit]
Description=MariaDB 10.4.8 database server
Documentation=man:mysqld(8)
Documentation=https://mariadb.com/kb/en/library/systemd/
After=network.target

[Install]
WantedBy=multi-user.target


[Service]

##############################################################################
## Core requirements
##

Type=notify

# Setting this to true can break replication and the Type=notify settings
# See also bind-address mysqld option.
PrivateNetwork=false

##############################################################################
## Package maintainers
##

User=mysql
Group=mysql

# CAP_IPC_LOCK To allow memlock to be used as non-root user
# CAP_DAC_OVERRIDE To allow auth_pam_tool (which is SUID root) to read /etc/shadow when it's chmod 0
#   does nothing for non-root, not needed if /etc/shadow is u+r
# CAP_AUDIT_WRITE auth_pam_tool needs it on Debian for whatever reason
CapabilityBoundingSet=CAP_IPC_LOCK CAP_DAC_OVERRIDE CAP_AUDIT_WRITE

# PrivateDevices=true implies NoNewPrivileges=true and
# SUID auth_pam_tool suddenly doesn't do setuid anymore
PrivateDevices=false

# Prevent writes to /usr, /boot, and /etc
ProtectSystem=full

# Doesn't yet work properly with SELinux enabled
# NoNewPrivileges=true

# Prevent accessing /home, /root and /run/user
ProtectHome=true

# Execute pre and post scripts as root, otherwise it does it as User=
PermissionsStartOnly=true



# Perform automatic wsrep recovery. When server is started without wsrep,
# galera_recovery simply returns an empty string. In any case, however,
# the script is not expected to return with a non-zero status.
# It is always safe to unset _WSREP_START_POSITION environment variable.
# Do not panic if galera_recovery script is not available. (MDEV-10538)
ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"
ExecStartPre=/bin/sh -c "[ ! -e /usr/bin/galera_recovery ] && VAR= || \
 VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] \
 && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1"

# Needed to create system tables etc.
# ExecStartPre=/usr/bin/mysql_install_db -u mysql

# Start main service
# MYSQLD_OPTS here is for users to set in /etc/systemd/system/mariadb.service.d/MY_SPECIAL.conf
# Use the [Service] section and Environment="MYSQLD_OPTS=...".
# This isn't a replacement for my.cnf.
# _WSREP_NEW_CLUSTER is for the exclusive use of the script galera_new_cluster
ExecStart=/usr/bin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION


# Unset _WSREP_START_POSITION environment variable.
ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"

KillSignal=SIGTERM

# Don't want to see an automated SIGKILL ever
SendSIGKILL=no

# Restart crashed server only, on-failure would also restart, for example, when
# my.cnf contains unknown option
Restart=on-abort
RestartSec=5s

UMask=007

##############################################################################
## USERs can override
##
##
## by creating a file in /etc/systemd/system/mariadb.service.d/MY_SPECIAL.conf
## and adding/setting the following under [Service] will override this file's
## settings.

# Useful options not previously available in [mysqld_safe]

# Kernels like killing mysqld when out of memory because its big.
# Lets temper that preference a little.
# OOMScoreAdjust=-600

# Explicitly start with high IO priority
# BlockIOWeight=1000

# If you don't use the /tmp directory for SELECT ... OUTFILE and
# LOAD DATA INFILE you can enable PrivateTmp=true for a little more security.
PrivateTmp=true

##
## Options previously available to be set via [mysqld_safe]
## that now needs to be set by systemd config files as mysqld_safe
## isn't executed.
##

# Number of files limit. previously [mysqld_safe] open-file-limit
LimitNOFILE=16364

# Maximium core size. previously [mysqld_safe] core-file-size
# LimitCore=

# Nice priority. previously [mysqld_safe] nice
# Nice=-5

# Timezone. previously [mysqld_safe] timezone
# Environment="TZ=UTC"

# Library substitutions. previously [mysqld_safe] malloc-lib with explicit paths
# (in LD_LIBRARY_PATH) and library name (in LD_PRELOAD).
# Environment="LD_LIBRARY_PATH=/path1 /path2" "LD_PRELOAD=
Environment="LD_PRELOAD=/usr/lib/libjemalloc.so"

# Flush caches. previously [mysqld_safe] flush-caches=1
# ExecStartPre=sync
# ExecStartPre=sysctl -q -w vm.drop_caches=3

# numa-interleave=1 equalivant
# Change ExecStart=numactl --interleave=all /usr/bin/mysqld......

# crash-script equalivent
# FailureAction=

I have done a fair bit of google searching but have not found anything that has helped. I can see from the main Archlinux page there was a manual intervention required for mariadb back in June. This is a fresh install only a few weeks old and my config files are in /etc/my.conf

Please let me know if further info is required

Thanks in advance

Last edited by arh85 (2019-10-01 00:57:42)

Offline

#2 2019-09-29 07:09:46

hoerbert
Member
Registered: 2013-04-03
Posts: 87

Re: [SOLVED] Unable to start mariadb.service

Hey arh85,

this sounds like you did not run mysql_install_db. Did you?

Greets

Torben

Offline

#3 2019-09-29 08:29:43

arh85
Member
Registered: 2019-09-29
Posts: 2

Re: [SOLVED] Unable to start mariadb.service

Hey arh85,

this sounds like you did not run mysql_install_db. Did you?

Greets

Torben

Yes I had  run that command and just now when I tried it again it said I need to upgrade not install.

I did notice when I was running the command with sudo I was still getting permission errors accessing my home folder which didn't look right. So i ran $ su and run the command again and it worked.

I was able to enable mysqld which is now showing as running enabled

[root@archvb ~]# systemctl start mysqld
[root@archvb ~]# systemctl status mysqld
● mariadb.service - MariaDB 10.4.8 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendo>
   Active: active (running) since Sun 2019-09-29 18:20:57 AEST; 39s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 12843 ExecStartPre=/bin/sh -c systemctl unset-environment _WSRE>
  Process: 12844 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ]>
  Process: 12885 ExecStartPost=/bin/sh -c systemctl unset-environment _WSR>
 Main PID: 12852 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 30
   Memory: 61.6M
   CGroup: /system.slice/mariadb.service
           └─12852 /usr/bin/mysqld

Thank you for the prompt smile

Offline

Board footer

Powered by FluxBB