1

Fresh install MariaDB on freshly installed Kubuntu 20.04. After successfully setting up MariaDB with the "stock" databases, it was running fine. Then I moved and renamed the original contents of /var/lib/mysql, and used a bind mount to bring in my real databases into the new /var/lib/mysql folder. After rebooting the real databases are in the correct folder, with the correct permissions, but the MariaDB server will no longer start. I have already used this procedure successfully with Kubuntu 19.04, Kubuntu 19.10, Manjaro, etc. I have not been able to make it work with Fedora 31, OpenSUSE, Mageia, etc.
Here are the outputs of systemctl status mariadb and journalctl -xe:

Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2020-04-30 14:55:16 CEST; 12min ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 3343 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 3348 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 3362 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 (code=exited, status=0/SUCCESS)
    Process: 3411 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
   Main PID: 3411 (code=exited, status=1/FAILURE)

Apr 30 14:55:16 murphy systemd[1]: Starting MariaDB 10.3.22 database server...
Apr 30 14:55:16 murphy mysqld[3411]: 2020-04-30 14:55:16 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB-1ubuntu1) starting as process 3411 ...
Apr 30 14:55:16 murphy systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Apr 30 14:55:16 murphy systemd[1]: mariadb.service: Failed with result 'exit-code'.
Apr 30 14:55:16 murphy systemd[1]: Failed to start MariaDB 10.3.22 database server.  


Starting MariaDB 10.3.22 database server...
-- Subject: A start job for unit mariadb.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit mariadb.service has begun execution.
-- 
-- The job identifier is 2434.
Apr 30 15:20:18 murphy mysqld[3849]: 2020-04-30 15:20:18 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB-1ubuntu1) starting as process 3849 ...
Apr 30 15:20:18 murphy systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- An ExecStart= process belonging to unit mariadb.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
Apr 30 15:20:18 murphy systemd[1]: mariadb.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit mariadb.service has entered the 'failed' state with result 'exit-code'.
Apr 30 15:20:18 murphy systemd[1]: Failed to start MariaDB 10.3.22 database server.
-- Subject: A start job for unit mariadb.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit mariadb.service has finished with a failure.
-- 
-- The job identifier is 2434 and the job result is failed.
Apr 30 15:21:13 murphy su[2897]: pam_unix(su:session): session closed for user root
Apr 30 15:21:13 murphy sudo[2896]: pam_unix(sudo:session): session closed for user root 

Can someone help me clarify this? Do I need to provide more information? Thanks,
theber

Attie: here is the output of journalctl -u mariadb.service

-- Logs begin at Sat 2020-04-25 15:11:36 CEST, end at Thu 2020-04-30 20:46:28 CEST. --
 Apr 30 13:25:09 murphy systemd[1]: Starting MariaDB 10.3.22 database server...
Apr 30 13:25:09 murphy mysqld[4197]: 2020-04-30 13:25:09 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB-1ubuntu1) starting as process 4197 ...
Apr 30 13:25:09 murphy systemd[1]: Started MariaDB 10.3.22 database server.
Apr 30 13:25:09 murphy /etc/mysql/debian-start[4233]: Upgrading MySQL tables if necessary.
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Looking for 'mysql' as: /usr/bin/mysql
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Phase 1/7: Checking and upgrading mysql database
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Processing databases
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.column_stats                                 OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.columns_priv                                 OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.db                                           OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.event                                        OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.func                                         OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.gtid_slave_pos                               OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.help_category                                OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.help_keyword                                 OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.help_relation                                OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.help_topic                                   OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.host                                         OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.index_stats                                  OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.innodb_index_stats                           OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.innodb_table_stats                           OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.plugin                                       OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.proc                                         OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.procs_priv                                   OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.proxies_priv                                 OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.roles_mapping                                OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.servers                                      OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.table_stats                                  OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.tables_priv                                  OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.time_zone                                    OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.time_zone_leap_second                        OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.time_zone_name                               OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.time_zone_transition                         OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.time_zone_transition_type                    OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.transaction_registry                         OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql.user                                         OK
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Phase 2/7: Installing used storage engines... Skipped
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Phase 3/7: Fixing views
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Processing databases
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: information_schema
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: performance_schema
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Phase 4/7: Running 'mysql_fix_privilege_tables'
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Phase 5/7: Fixing table and database names
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Processing databases
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: information_schema
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: mysql
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: performance_schema
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Phase 6/7: Checking and upgrading tables
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Processing databases
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: information_schema
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: performance_schema
Apr 30 13:25:10 murphy /etc/mysql/debian-start[4236]: Phase 7/7: Running 'FLUSH PRIVILEGES'

Output of /var/log/mysql/error.log:

2020-05-01  8:50:24 0 [Note] InnoDB: Using Linux native AIO
2020-05-01  8:50:24 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-05-01  8:50:24 0 [Note] InnoDB: Uses event mutexes
2020-05-01  8:50:24 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-05-01  8:50:24 0 [Note] InnoDB: Number of pools: 1
2020-05-01  8:50:24 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-05-01  8:50:24 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-05-01  8:50:24 0 [Note] InnoDB: Completed initialization of buffer pool
2020-05-01  8:50:24 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriorit>
2020-05-01  8:50:24 0 [Note] InnoDB: Downgrading redo log: 2*50331648 bytes; LSN=22077728
2020-05-01  8:50:24 0 [Note] InnoDB: Starting to delete and rewrite log files.
2020-05-01  8:50:24 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 50331648 bytes
2020-05-01  8:50:24 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 50331648 bytes
2020-05-01  8:50:24 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2020-05-01  8:50:24 0 [Note] InnoDB: New log files created, LSN=22077728
2020-05-01  8:50:25 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-05-01  8:50:25 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-05-01  8:50:25 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-05-01  8:50:25 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-05-01  8:50:25 0 [Note] InnoDB: Waiting for purge to start
2020-05-01  8:50:25 0 [Note] InnoDB: 10.3.22 started; log sequence number 22077728; transaction id 31153
2020-05-01  8:50:25 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-05-01  8:50:25 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-05-01  8:50:25 0 [Note] Recovering after a crash using tc.log
2020-05-01  8:50:25 0 [Note] Starting crash recovery...
2020-05-01  8:50:25 0 [Note] Crash recovery finished.
2020-05-01  8:50:25 0 [Note] Server socket created on IP: '127.0.0.1'.
2020-05-01  8:50:25 0 [ERROR] Fatal error: Can't open and lock privilege tables: 'mysql.user' is not of type 'TABLE'
4
  • What is the output of journalctl -u mariadb.service?
    – Attie
    Commented Apr 30, 2020 at 14:22
  • On distros with SELinux (e.g. Fedora), that could be part of a reason. Have you done restorecon -rv /var/lib/mysql ? Can you paste the relevant mysql error log (may be going to syslog, depending on your configuration). It'll tell you exactly why it's not starting. Commented Apr 30, 2020 at 20:44
  • @Attie: I have added the output of journalctl -u mariadb.service
    – theber
    Commented May 1, 2020 at 7:24
  • @GordanBobic: I'm pretty sure that Kubuntu does not use SELinux. I have added the output of /var/log/mysql/error.log above. The last line shows an error, but I cannot find this exact error message by searching online. I am reluctant to apply solutions that do not specifically apply, since the databases are working on this same machine under Manjaro.
    – theber
    Commented May 1, 2020 at 7:27

1 Answer 1

0

Are you sure you have this working on Manjaro on the exact same version of MariaDB l? Logs mention 10.3.22 in the question. From what I can see in Manjaro repositories, the version they currently ship is 10.4.

From 10.4, all system tables (including the user table) are in Aria format, in older versions they are in MyISAM format. This is exactly the sort of error I would expect if you were trying to start a database upgraded to 10.4 with 10.3 or earlier.

1
  • @GordonBobic: That makes sense. My Manjaro is using 10.4.12. I'll have to wait until MariaDB provides a 10.4 repository for Kubuntu 20.4.
    – theber
    Commented May 1, 2020 at 11:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .