MySQL DBConnect

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
TheEek
Junior Coder
Posts: 31
Joined: Mon Jun 22, 2009 2:53 pm

MySQL DBConnect

Post by TheEek » Tue Oct 29, 2013 10:31 am

I've just been upgraded with a new desktop PC. And after re-installing Macro Scheduler, I can no longer connect to my MySQL database using Macro Scheduler scripts. I can connect using from the command line.

The driver is installed, but I always get the same error. I've tried with various combinations of User/System and File DSNs just in case - all with the driver installed. I'm hoping someone can see the obvious error that I've made.

The basic test:

Code: Select all

let>str1=Driver={MySQL ODBC 5.1 Driver};Server=mysql_server;Database=myDB;Uid=username;Pwd=password;
let>str2=Driver={SQL Server};Server=sql_server;Uid=username;port=port;Pwd=password;
DBConnect>str1,DB1
DBConnect>str2,DB2
mdl>DB1: %DB1%%CRLF%%CRLF%DB2: %DB2%
DBClose>DB1
DBClose>DB2
Produces:

Code: Select all

DB1: ERR [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

DB2: 2
SQL Server and MySQL ODBC 5.1 Driver are both displayed on the Drivers tab on my ODBC. MSSQL connection works MySQL doesn't.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Oct 29, 2013 11:05 am

The script is trying to use the MYSQLC ODBC 5.1 driver. The latest available on the mysql website is 5.2x. Which one do you have installed? Have you made sure the script is referring to the one that is installed?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

TheEek
Junior Coder
Posts: 31
Joined: Mon Jun 22, 2009 2:53 pm

Post by TheEek » Tue Oct 29, 2013 3:35 pm

I've tried both, and made the adjustments in the scritp.. Currently I have 5.1 installed.

[/img]

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Oct 29, 2013 3:40 pm

Another thing to check - if you are running a 64 bit version of Windows check that you've installed the 32 bit MySQL connector (Macro Scheduler is 32 bit).
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

TheEek
Junior Coder
Posts: 31
Joined: Mon Jun 22, 2009 2:53 pm

Post by TheEek » Wed Oct 30, 2013 7:20 am

Yes, that was the fault. 64-bit OS, I downloaded the 32-bit version of the connector and it works now.

many thanks.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts