SQLines Data - Configure and Troubleshoot Connection to MariaDB

If you are going to connect to a localhost MariaDB database you do not need to setup any additional libraries to use SQLines Data tool as they are supplied with MariaDB server.

If you need to connect to a remote MariaDB database, you need to have MariaDB C API libmariadb installed in your system.

Before downloading check if you already have MariaDB libraries:

  • Linux:
    • libmariadb.so
  • Windows: (Drive letter and version can be different)
    • C:\Program Files\MariaDB\MariaDB Connector C 64-bit\lib\libmariadb.dll

If the MariaDB client is not available, go to MariaDB Download page https://mariadb.com/downloads/connectors/ and download MariaDB Connector C.

Setup SSL Connection

When connecting to a MariaDB database you can get the following error: SSL connection is required. Please specify SSL options and retry”

Use SSL connection options in sqldata.cfg or command line:

  • -mysql_ssl_mode - SSL connection mode (–ssl-mode MySQL option), possible values are DISABLED, PREFERRED (default), REQUIRED, VERIFY_CA and VERIFY_IDENTITY
  • -mysql_ssl_key - SSL private key file (–ssl-key MySQL option), the absolute path to the file
  • -mysql_ssl_cert - SSL certificate file (–ssl-cert MySQL option), the absolute path to the file in PEM format
  • -mysql_ssl_ca - SSL CA file (–ssl-ca option of MySQL CLI), the absolute path to the file in PEM format

Troubleshooting Connection on Windows

When you click Test Connection you get the following error:

  • Error Loading MariaDB C API libmariadb.dll. The specified module could not be found

Possible reasons:

  • MariaDB C API is not installed. Downlaod and install MariaDB C API client (MariaDB Connector C) at http://www.mariadb.com
  • MariaDB C API is installed but SQLines Data tool cannot find libmariadb.dll for some reason. Add the directory where libmariadb.dll is located (for example, C:\Program Files\MariaDB\MariaDB Connector C 64-bit\lib) to the PATH environment variable and restart SQLines Data tool.

To set the PATH variable on Windows, right-click the Computer icon, select Properties, click the Advanced System Settings. Then select Advanced tab and click the Environment Variables button. Go to System Variables, find and append Path.

Instead of the system PATH variable, you can also specify the path to MariaDB library using the -mariadb_lib option of SQLines Data configuration file sqldata.cfg. For example, you can set -mariadb_lib=C:\Program Files\MariaDB\MariaDB Connector C 64-bit\lib\libmariadb.dll

Contact us at support@sqlines.com if you still have any connection problems.