MariaDB/MySQL

Last change on 2022-12-28 • Created on 2020-01-20 • ID: KO-364AA

What is MariaDB/MySQL?

MariaDB/MySQL is an Open Source RDMS (Relational Database Management System) that uses SQL (Structured Query Language) to process information. It is a widely used application for websites which access databases.

Creating a MariaDB/MySQL database

On the main page of the MariaDB/MySQL database manager, you will see your list of databases, in which you can view all databases that currently exist.

How to create a new MariaDB/MySQL database:

  1. Click on "Add".
  2. On the following page, you will see the recommended (random) access details for your database. If you wish, you can provide your own password here.
  3. Select a name for the database as well as a name for the corresponding database user.
  4. The main password is the most important. It provides access to the whole database and allows you to create, change, or delete any database information, column, or row.
  5. The R/W (Read/Write) password only gives you read/write access. This is mostly used by the CMS (Content Management Systems) to add or change database information.
  6. The R/O (Read Only) password allows the application to only read information from the database. Information cannot be altered with this password.
  7. (Optional setting) Require SSL: When this is active, it prohibits all unencrypted connections to the database. This can have a negative effect on the accessibility of the database.
  8. Click on "Save" to create the database.
  9. You should receive a message that you successfully created the MariaDB/MySQL database. Click on "MariaDB/MySQL-Databases" to return to your database list.

Tip: If you receive an error message while creating the database, try to change the database name and/or username.

Manage your database(s)

In the overview, you can create a new database or modify, delete, back up, and access existing databases via phpMyAdmin.

If you wish to delete a database, konsoleH will require you to confirm that before finally deleting it. Be careful when you confirm it; you can not un-do the deletion.

Access your database via SSL

You can access your database in an encrypted manner using SSL. We can provide you with a ready-made certificate that you can use to carry out the encryption. Note: The speed of encrypted connections is slower.

The certificate is:

-----BEGIN CERTIFICATE-----
MIIG7jCCBNagAwIBAgIJAOHaB6/9NNBGMA0GCSqGSIb3DQEBCwUAMIGqMQswCQYD
VQQGEwJERTEPMA0GA1UECBMGQmF5ZXJuMRUwEwYDVQQHEwxHdW56ZW5oYXVzZW4x
GjAYBgNVBAoTEUhldHpuZXIgT25saW5lIEFHMRIwEAYDVQQLEwlEYXRhYmFzZXMx
GzAZBgNVBAMTEnNxbC55b3VyLXNlcnZlci5kZTEmMCQGCSqGSIb3DQEJARYXcm9v
dEBzcWw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LT8Cry1Wb
X40=
-----END CERTIFICATE-----

You can save the certificate locally as a text file (for example, as "sqlca.pem"). Once you have done that, you can make an encrypted connection. Unfortunately, however, it is not possible for you to use your own client certificates.

Example commands for encrypted access to MariaDB/MySQL:

  • MariaDB/MySQL command line
    mysql --ssl --ssl-ca sqlca.pem -h HOSTNAME ...
  • PHP (PDO)
    $pdo = new PDO('mysql:host=HOSTNAME;dbname=DBNAME', 'USERNAME', 'PASSWORD', array(PDO::MYSQL_ATTR_SSL_CA=>'sqlca.pem'));
  • PHP (mysqli)
    $db = mysqli_init();
    $db->ssl_set(NULL, NULL, 'sqlca.pem', NULL, NULL);
    $link = mysqli_real_connect ($db, 'HOSTNAME', 'USERNAME', 'PASSWORD','DBNAME', 3306, NULL, MYSQLI_CLIENT_SSL);
  • JAVA
    • For Java, first import the certificate into the keystore. Then you can establish the connection with:
    jdbc:mysql://[host][:port]/[database]?useSSL=true&requireSSL=true&trustCertificateKeyStorePassword=<secret>&trustCertificateKeyStoreUrl=file:/path/to/my/keystore

What is phpMyAdmin?

phpMyAdmin is a graphic database administration tool for MariaDB/MySQL. It is a good way to manage the database(s) without learning the SQL language.

Using the graphic interface, you can add, edit, and delete information easily.

For more information about phpMyAdmin, please visit the official website https://www.phpmyadmin.net/ .

For larger databases, we recommend using a query browser. Here are some examples of free query browsers: https://www.mysql.com/products/workbench/, https://www.heidisql.com/

Table of Contents