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/5920301ff79dcb88aab3ef7fa459733e#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