0

I had a hard drive that was failing, and cloned the disk to keep my server running. I noticed mysql wouldn't run, and tried to purge mysql, tried to install mariadb, tried purging that and reinstalling multiple times. It appears as though mysql/mariadb install just fine, but now I keep getting this failure:

Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mariadb.service - MariaDB 10.2.14 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: exit-code) since Fri 2018-04-13 09:12:43 MDT; 10ms ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 22033 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
  Process: 21876 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: 21870 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 21865 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
 Main PID: 22033 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"

Apr 13 09:12:41 SSDUbuntuServer mysqld[22033]: 2018-04-13  9:12:41 140424825977024 [Note] Plugin 'FEEDBACK' is disabled.
Apr 13 09:12:41 SSDUbuntuServer mysqld[22033]: 2018-04-13  9:12:41 140424825977024 [ERROR] mysqld: File '/var/log/mysql/mariadb-bin.000008' not found (Errcode: 2 "No ...directory")
Apr 13 09:12:41 SSDUbuntuServer mysqld[22033]: 2018-04-13  9:12:41 140424825977024 [ERROR] Failed to open log (file '/var/log/mysql/mariadb-bin.000008', errno 2)
Apr 13 09:12:41 SSDUbuntuServer mysqld[22033]: 2018-04-13  9:12:41 140424825977024 [ERROR] Could not open log file
Apr 13 09:12:41 SSDUbuntuServer mysqld[22033]: 2018-04-13  9:12:41 140424825977024 [ERROR] Can't init tc log
Apr 13 09:12:41 SSDUbuntuServer mysqld[22033]: 2018-04-13  9:12:41 140424825977024 [ERROR] Aborting
Apr 13 09:12:43 SSDUbuntuServer systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Apr 13 09:12:43 SSDUbuntuServer systemd[1]: Failed to start MariaDB 10.2.14 database server.
Apr 13 09:12:43 SSDUbuntuServer systemd[1]: mariadb.service: Unit entered failed state.
Apr 13 09:12:43 SSDUbuntuServer systemd[1]: mariadb.service: Failed with result 'exit-code'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package mariadb-server-10.2 (--configure):
 subprocess installed post-installation script returned error exit status 1

I'd love to get my database running again, but can't figure out why it won't start. I've purged and reinstalled both mysql and maria multiple times, and both give this same error.

Thanks!

edit

After giving write access to the log dirs above, I get

Apr 13 11:06:02 SSDUbuntuServer mysqld[8060]: 2018-04-13 11:06:02 140331412616960 [Note] InnoDB: FTS optimize thread exiting.
Apr 13 11:06:02 SSDUbuntuServer mysqld[8060]: 2018-04-13 11:06:02 140332290479872 [Note] Event Scheduler: Purging the queue. 0 events
Apr 13 11:06:02 SSDUbuntuServer mysqld[8060]: 2018-04-13 11:06:02 140332290479872 [Note] InnoDB: Starting shutdown...
Apr 13 11:06:02 SSDUbuntuServer mysqld[8060]: 2018-04-13 11:06:02 140331370653440 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
Apr 13 11:06:02 SSDUbuntuServer mysqld[8060]: 2018-04-13 11:06:02 140331370653440 [Note] InnoDB: Buffer pool(s) dump completed at 180413 11:06:02
Apr 13 11:06:03 SSDUbuntuServer mysqld[8060]: 2018-04-13 11:06:03 140332290479872 [Note] InnoDB: Shutdown completed; log sequence number 1620101
Apr 13 11:06:03 SSDUbuntuServer mysqld[8060]: 2018-04-13 11:06:03 140332290479872 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"

2 Answers 2

1

After more research, I found that /etc/mysql/debian-start was missing, and causing the failures. I created the file, and populated its contents with this version from mariadb and it all worked.

0

How was your drives setup before cloning? the lines

Apr 13 09:12:41 SSDUbuntuServer mysqld[22033]: 2018-04-13  9:12:41 140424825977024 [Note] Plugin 'FEEDBACK' is disabled.
Apr 13 09:12:41 SSDUbuntuServer mysqld[22033]: 2018-04-13  9:12:41 140424825977024 [ERROR] mysqld: File '/var/log/mysql/mariadb-bin.000008' not found (Errcode: 2 "No ...directory")
Apr 13 09:12:41 SSDUbuntuServer mysqld[22033]: 2018-04-13  9:12:41 140424825977024 [ERROR] Failed to open log (file '/var/log/mysql/mariadb-bin.000008', errno 2)
Apr 13 09:12:41 SSDUbuntuServer mysqld[22033]: 2018-04-13  9:12:41 140424825977024 [ERROR] Could not open log file
Apr 13 09:12:41 SSDUbuntuServer mysqld[22033]: 2018-04-13  9:12:41 140424825977024 [ERROR] Can't init tc log

Indicate that either the process is not finding the log dir or it doesn't have permissions to access whats already there. Try listing the /var/log/mysql/ directory first to see if there's anything there.

5
  • 1
    I fixed the access to the logs, I still get errors (see my edit). The drive was just a single ssd that was cloned using dd. It copied over just fine, but mysql refused to start up after switching to the new drive.
    – richie
    Apr 13, 2018 at 17:09
  • Ok, it would help if you show the entire output but off the top it looks like you may need to purge the binlogs look at mariadb.com/kb/en/library/sql-commands-purge-logs and mariadb.com/kb/en/library/mysqld_safe (you will have to start the database in safe mode). Apr 13, 2018 at 19:48
  • Hmm. It says there's nothing to clear, but starting with mysqld_safe works. Let me try to get the entire log
    – richie
    Apr 13, 2018 at 20:19
  • Looks like it's crashing on a mariadb.service: Failed at step EXEC spawning /etc/mysql/debian-start: No such file or directory or after touching a file, and setting permissions I get mariadb.service: Failed at step EXEC spawning /etc/mysql/debian-start: Exec format error
    – richie
    Apr 13, 2018 at 20:33
  • Looks to me like you could extract that file from the mariadb package, here's a similar issue unix.stackexchange.com/questions/421366/… Apr 15, 2018 at 15:33

You must log in to answer this question.

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