Van mysql naar mariadb, en SSL is required
mysql, mariadb
Uit oude gewoonte log ik op de commandolijn nog in op mijn database-servers met het “mysql” commando, hoewel ze ondertussen op mariadb draaien. Aangezien mariadb compatibel is/was met mysql, was dat nooit een probleem.
(ik ben “tester” op mijn lokale machine “tumbleweed”)
Maar nu:
tester@tumbleweed:~> mysql -u mydblogin -h dbserver01.mydomain.interal -p
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
Enter password: ...
Oplossing: eenvoudig mysql
vervangen door mariadb
als commondolijn oproep.
(ps: voorlopig kan je nog wel verder, en is het maar een waarschuwing)
Secure
De volgende fout dient zich dan aan:
tester@tumbleweed:~>mariadb -u mydblogin -h dbserver01.mydomain.interal -p
Enter password: ****
ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it
Het gebruik van de versleutelde verbinding is standaard geworden, en als je een reden hebt om dat niet te gebruiken (intern netwerk, ..) moet je het expliciet opgeven met een parameter als --skip_ssl
:
mariadb -u mydblogin -h dbserver01.mydomain.interal --skip_ssl -p
tester@tumbleweed:~> mariadb -u mydblogin -h dbserver01.mydomain.interal --skip_ssl -p
Enter password: ****
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2439
Server version: 10.11.8-MariaDB-0ubuntu0.24.04.1 Ubuntu 24.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> exit
Bye
De –help van de client zegt: Default options are read from the following files in the given order:
/etc/my.cnf ~/.my.cnf
In een post las ik:
If you don’t want to type –skip-ssl on the command line every time, you can instead add this to /etc/mysql/mariadb.conf.d/50-client.cnf or ${HOME}/.my.cnf
En inderdaad, als je een ~/.my.cnf bestand aanmaakt (was er nog niet bij mij) en/of daarin het volgende zet:
[client]
skip-ssl = true
Dan dan is het niet meer nodig om op de commandolijn de optie skip-ssl
mee te geven.