2

I am trying to connect to MySQL database using VBA from my local machine. The database is in the linux server(XXXX.xxx.edu). I have the SSH client in my machine through which I connect to the *****.xxx.edu server. Once when I login and use the below command, I am able to access the MySQL database without any problem.

mysql -p -h XXXX.XXX.edu -u username dbname

However,I need to run the VBA in my machine and insert the values into this database. I tried to connect using the code mentioned in the below link.

Error in VBA:`[Microsoft][ODBC Manager] Data source name not found and no default driver specified

As told in the suggestion of the above link, I installed the MYSQL ODBC drivers which installed the MySQL 5.5 in my machine. Even after installing, I get the error,

[Microsoft][ODBC Manager] Data source name not found and no default driver specified

I am not able to figure out what exactly is the problem. How should I connect to the linux server and then connect to the MySQL database?

7
  • got some ports open or just 22 ? Commented May 25, 2013 at 0:53
  • well open up 3306 bud Commented May 25, 2013 at 0:57
  • Yeah. I did that. But still I get the data source name not found error. Commented May 25, 2013 at 1:00
  • can you see the list of databases in odbc config ? Commented May 25, 2013 at 1:00
  • How do I check it? I created a text document and saved it in the .udl format. In that datalink file, I see a list of providers like Microsoft OLE Provider. However, I am not sure how to check the databases. Commented May 25, 2013 at 1:03

1 Answer 1

2
you install the mysql odbc driver (the msi) from here.
http://dev.mysql.com/downloads/connector/odbc/
you run ODBC Data Source Administrator
go to System DSN
click Add
select, for instance, MySql ODBC Unicode Driver
click finish.
dns name: fred
description: fred
tcpip server: 192.168.1.11 (whatever, dns, so long as u can point to it)
port 3306
user: root (whatever)
pwd: whatever works
drop down database, click test or view them
Sign up to request clarification or add additional context in comments.

2 Comments

I get the error "The specified DSN contains an architecture mismatch between the driver and the application". I installed the odbc driver from the given link and able to create the data source as mentioned in the above steps. This is the code in my VBA. Dim oConn As ADODB.Connection Set oConn = New ADODB.Connection oConn.Open "ramesh"
This worked for me to help connect from Excel into a MySQL database hosted on my Homestead virtual machine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.