SQLines Data - Configure and Troubleshoot Connection to MySQL

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

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

Before downloading check if you already have MySQL libraries:

If MySQL client is not available, go to MySQL Download page https://dev.mysql.com/downloads/connector/ and download MySQL Connector/C or C API (libmysqlclient):

  1. Select C API (libmysqlclient) (https://dev.mysql.com/downloads/c-api/)
  2. Select MySQL Product Archives (https://downloads.mysql.com/archives/c-c/)
  3. Download in install the connector
  4. Add MySQL lib directory to PATH (C:\Program Files\MySQL\MySQL Connector C 6.1\lib i.e.)

Installing MySQL Connector/C on Linux

Download the latest version of MySQL Connector/C, for example, mysql-connector-c-6.1.9-linux-glibc2.5-x86_64.tar.gz and extract files:

tar -xvzf mysql-connector-c-6.1.9-linux-glibc2.5-x86_64.tar.gz

You can find libmysqlclient.so library at lib directory. Before running sqldata command, add MySQL library location to LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<mysql_connector_dir>/lib

An alternative way to install MySQL libraries is to run:

yum install mysql-devel

If your .so file ends with the library version, for example, libmysqlclient.so.16 then create a symbolic link, so SQLines Data tool is able to load the required library:

cd <mysql_connector_dir>/lib
ln -s libmysqlclient.so.16 libmysqlclient.so

Setup SSL Connection

When connecting to a MySQL 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:

Troubleshooting Connection on Windows

When you click Test Connection you get the following error:

Possible reasons:

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.

Note. You have to restart SQLines Data tool after modifying the PATH environment variable.

You can also edit sqldata.cfg configuration file and set -mysql_lib option.

To fix this issue set the environment variable LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN=1. To do this 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 and add the variable.

Note. You have to restart SQLines Data tool after adding an environment variable.

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