← Back to team overview

maria-discuss team mailing list archive

Re: Installing MariaDB Alongside MySQL


 Good morning Muhammad,

I have checked and I am using your mariadb.service file. For some reason,
mariadb is failing to start.  We need to determine if the issue is coming
from systemd or something in MariaDB datadir.

To start it without systemd, run:

/opt/mariadb/bin/mysqld --defaults-file=/opt/mariadb-data/my.cnf &
The below should work:
/opt/mariadb/bin/mysqladmin  --defaults-file=/opt/mariadb-data/my.cnf
-uroot -p version
/opt/mariadb/bin/mysqladmin  --defaults-file=/opt/mariadb-data/my.cnf
-uroot -p shutdown

If the above does not work, you need to re-initialise mariadb:

kill the mysqld running as mariadb user.
cd /opt/mariadb-data
cp -p my.cnf /tmp
rm -rf *
cp -p /tmp/my.cnf .
rm -rf *   # Attention data loss step
cd /opt/mariadb-10.2.14-linux-x86_64/
scripts/mysql_install_db --user=mariadb

Otherwise its a systemd issue:
In that case can you provide the output of the following commands:

ps -ef | grep mysql
systemctl status mariadb
systemctl start mariadb
ps -ef | grep mysql
systemctl status mariadb

Hope this helps

On Tue, May 15, 2018 at 10:05 AM, Muhammad Bashir Al-Noimi <
mbnoimi@xxxxxxxxx> wrote:

> On 05/12/2018 11:56 PM, Kenneth Penza wrote:
> I have installed a new Ubuntu VM 16.04, installed MySQL 5.7 from Ubuntu
> repositories and MariaDB using the outline provided in the link
> https://ubuntuforums.org/showthread.php?t=2391680&p=13765881#post13765881 and
> got it working.
> The problem is stemming from the configuration files. By default, both
> MariaDB and MySQL read the options from /etc/mysql/my.cnf. A side effect of
> this is that the MariaDB installation under /opt is reading from
> /etc/mysql that has the options for MySQL, which is causing all your
> errors. To get around this you need to use the "--defaults-file=/opt/mariadb-data/my.cnf"
> option with every MariaDB command.
> If you take a look into my snippet of /etc/systemd/system/mariadb.service
> you'll notice that I call --defaults-file with ExecStart property so I
> suppose it should work fine when I call systemctl start mariadb.service but
> it doesn't :(
> https://gist.github.com/mbnoimi/5920301ff79dcb88aab3ef7fa45973
> 3e#file-mariadb-service-L19
> ExecStart=/opt/mariadb/bin/mysqld --defaults-file=/opt/mariadb-data/my.cnf
> # systemctl start  mariadb
> # /opt/mariadb/bin/mysqladmin --defaults-file=/opt/mariadb-data/my.cnf
> -uroot -p version
> # /opt/mariadb/bin/mysqladmin --defaults-file=/opt/mariadb-data/my.cnf
> -uroot -p version
> Enter password:
> /opt/mariadb/bin/mysqladmin: connect to server at 'localhost' failed
> error: 'Can't connect to local MySQL server through socket
> '/opt/mariadb-data/mariadb.sock' (2)'
> Check that mysqld is running and that the socket:
> '/opt/mariadb-data/mariadb.sock' exists!
> #
> root@ubuntu:/etc/mysql# mysqladmin --defaults-file=/opt/mariadb-data/my.cnf
> --print-defaults
> # mysqladmin --defaults-file=/opt/mariadb-data/my.cnf  --print-defaults
> mysqladmin would have been started with the following arguments:
> --port=3308 --socket=/opt/mariadb-data/mariadb.sock
> #
> --
> Best Regards,
> Muhammad Bashir Al-Noimi
> Skype+Telegram+GMail: mbnoimi

Follow ups