Accessing your MariaDB instance
MariaDB in Pukki is still in beta
This means that it hasn't been tested as extensively as PostgreSQL, and there might still be large changes to how Pukki manages MariaDB database instances. We hope to move out of beta in March 2025.
Graphical user interface
You can find a non-comprehensive list of different graphical interfaces for using MariaDB on MariaDB's homepage.
Command-line client mariadb and mysql
MariaDB's documentation client
The recommended CLI client to use is mariadb
. The mysql
client does still work, but is
usually a symbolic link to mariadb
.
Example commands for accessing your database:
or
--ssl
means the MariaDB client connects using SSL. This is necessary as Pukki database instances enforce encrypted connections.--password
means the client prompts for a password. You can specify one on the command line (like--password=password
), but that is considered insecure.--host
specifies the host address to connect to. In Pukki this is almost always your database instance's public IP address.--user
specifies which user to connect to the database as.${DATABASE_NAME}
specifies which database on the server to connect to.
Using command line with .my.cnf
If you are frequently connecting to the same database, it might be worthwhile to set up a
.my.cnf
configuration file in your home directory to store the necessary flags and options.
- Create an empty
.my.cnf
file in your home directory, and restrict its access permissions:
- Edit the configuration file with your favorite editor and add the following options:
As storing the password in a plaintext file isn't recommended, you can leave it empty to always prompt for the password when connecting:
Common issues with CLI connections
If a password prompt appears, but the client is afterwards stuck connecting for a long time, you should
double-check that the host
argument is correct, and that the firewall allows connections from your client's
address.
ERROR 3159 (08004): Connections using insecure transport are prohibited while --require_secure_transport=ON.
You tried to connect to the database without --ssl
.
Either your password or your username is wrong.
Either the database specified does not exist, or the username specified has no access to it.
Accessing your Pukki MariaDB database from Puhti
- Ensure your database instance allows network traffic from Puhti.
ssh
onto Puhti and load themariadb
module- Now you can connect to the database with the mariadb-client
Some useful SQL commands
List databases
List tables
Show table descriptions
Change database
Example query
Show all database settings
or if you want to show a subset you can use LIKE
%
here indicates a wildcard - this lists all variables that begin with innodb
.
Import database dump