On 05/12/2018 11:56 PM, Kenneth Penza
wrote:
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