Lukas Beran
Lukas Beran

Welcome to my blog! If you're looking for tutorials, hints or tips for IT, you're right here. You will find mostly articles on Microsoft products and technologies - operating systems, servers, virtualization, networks, management, but also the cloud. Sometimes I add some other interesting things.

September 2019


Encrypted database connection in Adminer

Lukas BeranLukas Beran

Adminer is a database management tool by Czech author Jakub Vrána. This is a much improved and simplified replacement for the popular phpMyAdmin. However, by default, Adminer does not support encrypted connection to a database. However, fix is very simple 🙂

How to install Adminer plugins

Adminer has many official plugins and you can also write your own at any time. For plugins to work, it is necessary to create a new php file that you will open and in which will be defined Adminer plugins including the Adminer file itself.

For example, we store the above code in the index.php file. Save the adminer.php file with the Adminer itself to the same directory. Next, create a plugins folder to upload the plugins you want to use. For each plugin, we need to find out the name of the class that the plugin defines, which is at the beginning of each plugin’s source code. So, for example, the dump-xml.php plugin creates a new AdminerDumpXml class whose name we enter in the plugin array in the source code above. Upload the php file of the plugin to the plugins directory. We must also save the default plugin.php file in this directory, which is required to load any plugin.

So in the root directory there will be index.php file with source code above, default adminer.php with source code of Adminer itself and plugins directory. The plugins directory will contain the plugin.php file, which is required for all plugins in general, and the php files for each plugin.

Login-ssl plugin in Adminer for encrypted database connection

Now we know how to work with plugins for Adminer in general, so we can look at the encrypted connection to a database. For the encrypted connection to a database to work in Adminer, it is necessary to download the login-ssl plugin and install it as described above.

For this plugin, however, you need to install the certificate of the authority that issued the certificate used to encrypt communication with the database. This certificate is then passed, including the path, as the login-ssl plugin argument. Thus, the entire code of the index.php file with the certificate stored in the cert.pem file in the plugins folder might look like this.

My primary focus is the security of identities, devices and data in the cloud using Microsoft services, technologies and tools.

Comments 0
There are currently no comments.