Page 1 of 1

Install MariaDB 10.1 on Ubuntu 16.04 [Error]

Posted: Sun May 21, 2017 4:35 pm
by CloudMedia
How to install MariaDB on Ubuntu 16.04?

I got error everytime:
SpoilerShow
Setting up mariadb-server-10.1 (10.1.23+maria-1~xenial) ...
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 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 Sun 2017-05-21 19:32:16 MSK; 7ms ago
Process: 2741 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Process: 2723 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: 2718 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 2714 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Main PID: 2741 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"

May 21 19:32:15 explanrtp.com mysqld[2741]: 2017-05-21 19:32:15 139932261783808 [ERROR] Plugin 'InnoDB' init function returned error.
May 21 19:32:15 explanrtp.com mysqld[2741]: 2017-05-21 19:32:15 139932261783808 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
May 21 19:32:15 explanrtp.com mysqld[2741]: 2017-05-21 19:32:15 139932261783808 [Note] Plugin 'FEEDBACK' is disabled.
May 21 19:32:15 explanrtp.com mysqld[2741]: 2017-05-21 19:32:15 139932261783808 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
May 21 19:32:15 explanrtp.com mysqld[2741]: 2017-05-21 19:32:15 139932261783808 [ERROR] Unknown/unsupported storage engine: InnoDB
May 21 19:32:15 explanrtp.com mysqld[2741]: 2017-05-21 19:32:15 139932261783808 [ERROR] Aborting
May 21 19:32:16 explanrtp.com systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 21 19:32:16 explanrtp.com systemd[1]: Failed to start MariaDB database server.
May 21 19:32:16 explanrtp.com systemd[1]: mariadb.service: Unit entered failed state.
May 21 19:32:16 explanrtp.com systemd[1]: mariadb.service: Failed with result 'exit-code'.
dpkg: error processing package mariadb-server-10.1 (--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.1 (= 10.1.23+maria-1~xenial); however:
Package mariadb-server-10.1 is not configured yet.

dpkg: error processing package mariadb-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mariadb-server-10.1
mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

1) sudo apt-get install software-properties-common
2) sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
3) sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.mephi.ru/mariadb/repo/10.1/ubuntu xenial main'
4) sudo apt update
5) sudo apt install mariadb-server


vesta error.log
SpoilerShow
2017-05-21 19:29:14 v-restart-service 'mysql' [Error 20]
2017-05-21 19:57:46 v-add-database 'admin' '444' '444' '******' 'mysql' 'localhost' 'utf8' [Error 15]
2017-05-21 19:59:51 v-add-database 'admin' '464646' '464646' '******' 'mysql' 'localhost' 'utf8' [Error 15]
2017-05-21 20:01:22 v-add-database 'admin' '464646' '464646' '******' 'mysql' 'localhost' 'utf8' [Error 15]
2017-05-21 20:01:26 v-add-database 'admin' '464646' '464646' '******' 'mysql' 'localhost' 'utf8' [Error 15]
2017-05-21 20:05:44 v-add-database 'admin' '356356' '3653636' '******' 'mysql' 'localhost' 'utf8' [Error 12]
2017-05-21 20:09:29 v-restart-service 'mysql' [Error 20]
2017-05-21 20:10:54 v-restart-service 'mysql' [Error 20]
2017-05-21 20:10:54 v-restart-service 'mysql' [Error 20]
2017-05-21 20:15:08 v-add-database 'admin' '3366363' '633666336' '******' 'mysql' 'localhost' 'utf8' [Error 15]

Re: Install MariaDB 10.1 on Ubuntu 16.04 [Error]

Posted: Wed May 24, 2017 5:43 am
by plutocrat
Are you downgrading from mysql 5.7? Mariadb 10.1 is based on mysql 5.6 and there are a lot of major changes between the two (possibly mysql should have called 5.7 version 6.0 instead!). In particular, they changed the name of the password column!

My experiences are detailed in this thread: viewtopic.php?t=13839

Summary.
You have mysql 5.7 installed. Back up the database by tarring /var/lib/mysql. Back it up again through mysqldump. The more backups the better.
Install mariadb using apt-get. This will give you mariadb 10.0. Run the commands to roll back the tables in the database.
Upgrade to mariadb 10.1 by adding repositories. Run the upgrade script.
All should now be working. If not, you have to roll back to mysql 5.7, and restore your data from a backup.

This would be much easier if we were given the choice of mariadb on install! Another option if you're setting up a fresh server, is to download the install script, and edit it so that it installs mariadb instead of mysql, before running it.