Log dari apt-get install mariadb-server atau apt-get install -f

Setting up mariadb-server-10.0 (10.0.29-0ubuntu0.16.04.1) …
dpkg: error processing package mariadb-server-10.0 (–configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mariadb-server:
mariadb-server depends on mariadb-server-10.0 (>= 10.0.29-0ubuntu0.16.04.1); however:
Package mariadb-server-10.0 is not configured yet.

dpkg: error processing package mariadb-server (–configure):
dependency problems – leaving unconfigured
No apport report written because the error message indicates it’s a follow-up error from a previous failure.
Errors were encountered while processing:
mariadb-server-10.0
mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Log error dari journalctl -u mysql

— Logs begin at Mon 2017-04-17 10:59:21 WIB, end at Mon 2017-04-17 11:12:03 WIB. —
Apr 17 10:59:28 librenms systemd[1]: Starting LSB: Start and stop the mysql database server daemon…
Apr 17 10:59:30 librenms mysql[1086]: * Starting MariaDB database server mysqld
Apr 17 10:59:33 librenms mysql[1086]: cat: /var/run/mysqld/mysqld.pid: No such file or directory
Apr 17 10:59:33 librenms mysql[1086]: …fail!
Apr 17 10:59:33 librenms systemd[1]: mysql.service: Control process exited, code=exited status=1
Apr 17 10:59:33 librenms systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Apr 17 10:59:33 librenms systemd[1]: mysql.service: Unit entered failed state.
Apr 17 10:59:33 librenms systemd[1]: mysql.service: Failed with result ‘exit-code’.
Apr 17 11:00:49 librenms systemd[1]: Stopped LSB: Start and stop the mysql database server daemon.
Apr 17 11:08:06 librenms systemd[1]: Stopped LSB: Start and stop the mysql database server daemon.
Apr 17 11:09:56 librenms systemd[1]: Stopped LSB: Start and stop the mysql database server daemon.

Solusi

1. Backup database

cp -r /var/lib/mysql /tmp/

2. Hapus Direktori Data MariaDB

rm -fr /var/lib/mysql

3. Install MariaDB Server

apt-get install mariadb-server mariadb-client

4. Restore Database

cp -r /tmp/mysql /var/lib/

5. Ubah Permission Folder Data MariaDB

chown mysql:mysql /var/lib/mysql -R

6. Jalankan MariaDB Server

service mysql start

Leave a comment

Your email address will not be published. Required fields are marked *