Quick MySQL Setup and test on Linx

MySQL is a great database tool if you need a powerful database, but free to use. However, it does take a couple more steps to set it up and get it working on Linx. I have followed these steps to connect to MySQL with Linx.

  1. First, I’ve installed MySQL, by installing WAMP on a new Windows server, from WampServer, la plate-forme de développement Web sous Windows - Apache, MySQL, PHP . This is a quick way to get a working MySQL server up and running with the required admin tools like phpMyAdmin. Remember the default username and password for MySQL on WAMP is root with a blank password. The default MySQL port is 3306

  2. Then I created a small database called LinxTest with a table with the following structure, and added a couple of rows of data to test on:

    43

  3. To connect to this database, you’ll have to install the ODBC drivers for MySQL. https://dev.mysql.com/downloads/connector/odbc/

  4. Run the ODBC Data Sources utility to add a new Data source:

    05

**Please note from comments below, select the “System DSN” tab if you want to run your solution in Linx Server.

  1. Create a new data source and give it a DSN (Data source name):

  2. Use the new DSN and set up a connection on your Linx Database function, using ODBC as the connection type (i.e. ExecuteSQL):

Done, now you can perform data queries, stored procedures etc on a MySQL Database.

Example solution (Linx 5.14):
MySQLTest (1).lsoz (4.5 KB)

hi,

When I start the solution in Designer, it works perfect, but when started from Server. it returns an error.

EventException, 64e423a6b8d04c179265a12b44173bb6, Twenty57.Linx.Runtime.SDK.LinxException: TimerEvent.Process: Process.ExecuteSQL: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified —>

What could be the problem?

note: I use ODBC driver for MySQL, and works fine starting from Linx Designer.

Hi Mojito,

Thank you for highlighting this. I missed a step after (4). Please add the new Data Source Name under the “System DSN” tab (and not the default User tab). This will allow your System processes (like Linx Server) to find your database.

06

Regards,
Dawie

Thanks a lot guys. It works fine for me now.

Thanks once again.

Quick note to add, if you do not want to do the DSN step in setting up a MySQL connection, you can simply expand the Connection string with the details:

Uid=root;Pwd=******;Driver={MySQL ODBC 8.0 ANSI Driver};Server=134.125.119.154;Database=LinxHosting;

image001 (1)

2 Likes

If you’re looking for a easy and more up to date installation I found this really nice setup guide for installing the MySQL Community workbench for Windows 10.

1 Like

Hi Dawie,
Is it possible to connect a MySQL DB with ssh to Linx?
I’m really struggling on this :confused:
Thanks in advance

Hi Mahdi,
We’ll need to set up an example of this. How is your MySQL setup for SSH? Generally we’ve been using ODBC drivers for MySQL access.

Hi Dawie,
For now I use MySQL Workbench to read the data but I wanna make some processes with Linx using this DB. So any solution / suggetion is welcomed ^^
Thanks in advance for your help