microsoft odbc driver manager data source name not found and no default driver specified - mysql

I am trying to run a Classic ASP application on Windows 8.1. It keeps on failing with error: data source name not found and no default driver specified
I am using an Access database. I have the same problem using a MySQL database. I tried with both 32 bit and 64 bit MySQL drivers -- first installing one then uninstalling and then installing the other.
driver={MySQL ODBC 5.3 Driver};option=3;server=localhost;user=root;password=;DATABASE=test;
I'm using these MySQL ODBC drivers:
mysql connector 5.3.4 - win32
mysql connector odbc 5.3.2 - winx64

Access can't be accessed through the MySQL drivers (they're for MySQL not Ms Access), what you need is the Microsoft OLEDB database connections.
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccessFile.accdb;
Jet OLEDB:Database Password=MyDbPassword;
Source; https://www.connectionstrings.com/access/
Also for MySQL, if you're running a 32bit MySQL server on a 64bit machine the standard ODBC management tool won't work since it's the 64bit version by default.
You'd need to install in on the 32bit ODBC manager here c:\Windows\SysWOW64\odbcad32.exe
Once that's done you'd need the following connection string to work with a 32bit DB on a 64bit machine. Provider=MSDASQL;Driver={MySQL ODBC 5.2 ANSI Driver};Server=localhost;
Database=myDataBase;User=myUsername;Password=myPassword;Option=3;
Source; https://www.connectionstrings.com/mysql-connector-odbc-5-2/

Related

Linking MySQL to MS SQL Server using OBDC Drivers (Error 7303)

I am trying to make a link between MySQL and MSSQL databases using ODBC Drivers. The reason is that our website is built using PHP and MySQL and we need to manage the database from SQL Server Manag. Studio.
I have already linked MySQL to MS ACCESS, so MySQL ODBC drivers are fully working.
When I try to link them from MICROSOFT SQL SERVER MANAGEMENT STUDIO > SERVER OBJECTS > LINKED SERVERS > NEW LINKED SERVER...
With this configuration:
I get this error:
I have tried with all these versions of MySQL OBDC Drivers:
ODBC 5.3 Unicode (32-bit) - This one is the one working with MS ACCESS
ODBC 5.3 ANSI (32-bit)
ODBC 5.3 Unicode (64-bit)
ODBC 5.3 ANSI (64-bit)
ODBC 8.0 Unicode (64-bit)
ODBC 8.0 ANSI (64-bit)
For the NEW LINKED SERVER:
I have tried writing this in "Provider string":
Driver={MySQL ODBC 5.3 ANSI Driver};
DATABASE=myDB;OPTION=134217728;PWD=myPASS;UID=myUSER;SERVER=mySERVER
ODBC:DSN=KARALIGROUP32::Table=myTABLE
I have also tried writing myTABLE in "Catalog".
For the Security tab, I have tried all four options given. (In the last option, I typed the login for MySQL DB and also for SQL Server)
For the Server Options tab, I have tried given RPC and RPC out (both in TRUE or both in FALSE)
I also have to mention that the database SQL Server is not my own one, so I don't have full credentials. This is my user's permissions from SECURITY > LOGINS.
My conclusion: I think it is about MS SQL SERVER MANAGEMENT STUDIO configuration or my permissions as the user.
Thanks for your help!
Update:
I have followed the advise given by TallTed, it didn't work as yet.
In the Security and Server Options tabs, I have left them as shown in the previous screenshots.
I have also tried all the ODBC connections shown in the screenshot.
Any other ideas? Thanks for your help!
First off -- the error you've shown has nothing to do with your SQL Server user permissions.
Next -- it's important to remember that Microsoft SQL Server isn't really an ODBC client application. It is an OLE DB and an ADO.NET client application.
Also note -- 64-bit SQL Server requires a 64-bit ODBC driver; 32-bit SQL Server requires a 32-bit ODBC driver. There are some extra gotchas with 64-bit SQL Server, as described in this article on my employer's site.
If your data is strictly 8-bit "narrow" codepages, then you do not need a Unicode driver, and will probably find it easier to work with the ANSI driver. That said, given that you have ODBC 5.3 Unicode (32-bit) working with Access, I would think you'll have success using that or ODBC 5.3 Unicode (64-bit) with SQL Server.
Now -- a possible step toward success.
In your first screenshot, Product Name must be MSDASQL. You will need no Provider String, because this string comes from your ODBC DSN.
I solved it!
I was using a client computer. I installed the driver in the server and then followed this post: https://www.mssqltips.com/sqlservertip/4570/access-mysql-data-from-sql-server-via-a-linked-server/
Thanks and I hope it would help someone!

Getting DSN architecture mismatch between Excel and ODBC MySql Connector

I'm getting the following error using Excel trying to add an external data source to the spreadsheet.
[Microsoft][ODBC Driver Manager]The specified DSN contains an architecture mismatch between the Driver and Application.
I can't find a compatibility chart between MySql and the MySql-ODBC Connector versions, but I got the latest that I could find. This is what I'm using:
mysql: 5.6.16 winx64
ConnectorODBC: 5.3.2x64
I've tried both the Ansi and Unicode versions of the driver. When adding it using the Windows Administrative Tools->Data Sources (ODBC) link the Test button says it connected successfully.
Data Source Name: Loans
TCP/IP server: localhost
Port: 3306
User:
Password:
Database: Loans
Thanks,
Ben
Your problem is that your client, Excel, is 32bit and needs to connect to a 32bit ODBC driver. Your 32bit ODBC driver will connect to a 64bit app just fine, what's important is that the client connects to a driver with the same architecture. On %windir%\syswow64 you'll find a file called odbcad32.exe, it's your 32bit ODBC control panel, add your 32bit MySQL ODBC driver there and use that to connect.

Which connection string for MySql ODBC connector 5.2.6?

it seems i can't make work a connection to MySql using ODBC connector 5.2.6.
In a 64 bit environment, in a VBA excel application, i use this string, but it not work:
"Driver={MySQL ODBC 5.2
Driver}; Server=myserver;Database=mydb;User=readonly;Password=mypass;Option=3"
I have also used
Driver={MySQL ODBC 5.2w Driver}
and
Driver={MySQL ODBC 5.2a Driver}
But the error is: ODBC driver unknow.
Can someone help me ?
Ps: it works with a DSN setted, but i would like to use a connection string so i don't go to each user computer and set a DSN.
Thanks
Quick Answer
Make sure you have installed the correct ODBC version (64-bit or 32-bit), matching the software.
Try the following:
Replace Driver={MySQL ODBC 5.2w Driver} with Driver={MySQL ODBC 5.2 Unicode Driver}
Replace Driver={MySQL ODBC 5.2a Driver} with Driver={MySQL ODBC 5.2 ANSI Driver}
Long Answer
The Driver={driver name} part of an ODBC connection string is the driver name that is listed in the Data Sources (ODBC) dialog.
Because you are running in a 64-bit environment, what you do next depends on whether you are running Excel (or whatever the software, web app etc.) as 32-bit or 64-bit, and therefore make sure you've installed the appropriate MySQL ODBC driver version. This is probably the most common problem people run into with ODBC drivers on 64-bit systems.
For those running web servers and trying to get 32-bit ODBC drivers to work in their 32-bit web app, make sure you enable 32-bit applications on the application pool. Here is a forum post describing how to do this: http://forums.iis.net/post/2023543.aspx
64-bit
If the software is 64-bit then open the Run dialog box, and run %windir%\System32\odbcad32.exe.
Click the Drivers tab, and find the MySQL ODBC driver listed, remember the name in the Name column, and use that in the connection string.
For 5.2.6 this will most likely be: MySQL ODBC 5.2 Unicode Driver
Where the driver name you tried before was 5.2w use the Unicode driver, where it was 5.2a use the ANSI driver.
32-bit
If the software is 32-bit then in the Run dialog box run %windir%\SysWOW64\odbcad32.exe to open the 32-bit Data Sources dialog, and then do the same as above.
On 64-bit machines using the 32-bit driver, it is recommended to start the connection string with Provider=MSDASQL;
I had a similar problem with Access 2010/2013 and windows 7. I assumed that I needed the 64 bit driver for a 64 bit environment and could not make a connection whatever I did. I finally downloaded and installed the 32bit version and am now able to connect to MySQL database on a remote server. As Excel is an also Office product I expect the problem/solution is the same.

visual studio 2010 odbc driver mysql, failed to call ODBC driver connection utility

n win7 64bits, I have Visual Studio 2010 SP1
MySql connector net 6.5.6
MySql connector odbc 5.2.5 winx64
On Localhost I have the MySql database and can connect with MySqlWorkbench.
I have made a user-DSN and a system-DSN on the MySQL database.
In VS2010 I try to make a server Explorer- Data Connection with Micorsoft ODBC Data Source (ODBC) and select the system-data-source name and click OK.
Then I get the message 'Failed to call the ODBC driver connection utility'.
I have tried connector net 6.7.4, but than on a click the window 'add connection' disappears. Connector odbc 5.1.12 does not fix the problem.
In VS2005 on winXP with MySQL odbc 3.51 I can make a connection.
Is there something I miss for VS2010 ?
Deperate looking for a solution, after 2 days of trying :-(
Regards

Excel VBA connect to MySQL - architecture mismatch error

I am trying to connect to MySQL from my local machine located on a server using VBA. Initially I was receiving the below error.
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
After some research, I figured out that the MySQL ODBC driver should be installed first. I installed the driver from the below location.
http://dev.mysql.com/downloads/connector/odbc/
I have a 64 bit machine and so I installed the driver for 64 bit and tried to establish the connection. Even then I was receiving the same data source name not found error. However from the ODBC data source administrator, if I select System DSN, I am able to see MySQL driver installed and I am able to create a new data source for my database in the server.
However from VBA, if I call the data source I receive another error.
[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application.
This is how I am calling the data source from my VBA.
Dim oConn As ADODB.Connection
Set oConn = New ADODB.Connection
oConn.Open "data_source_name"
Also,for the 64 bit ODBC connector I am able to see two drivers as below in my System DSN.
MySQL ODBC 5.2 ANSI Driver
MySQL ODBC 5.2 Unicode Driver
For both of the drivers, my connection is successful from the ODBC data administrator.
I tried to figure out a solution for the architecture mismatch problem and I read if I create the DSN by running the ODBC application from the below location on a 64 bit machine, it might work.
C:\Windows\System32\odbcad32
However for this scenario too, I received the same architecture mismatch error.
I even tried installing MySQL Connector/ODBC 5.2.5 32 bit in my machine. For this case, I am not able to see the driver listed in the system DSN.
Can someone help me figure out what am actually doing wrong?
I can select and loop thru results sets and do inserts. data verified in db. let me know if you need help
windows 7 Ultimate
version 6.1 (build 7601: service pack 1)
64 bit
************************************************************************
ODBC Data Source Administrator
run by command: %windir%\system32\odbcad32.exe
2 drivers:
MySQL ODBC 5.2 ANSI Driver , 5.02.05.00, Oracle, MYODBC5A.DLL, 4/4/2013
MySQL ODBC 5.2 Unicode Driver , 5.02.05.00, Oracle, MYODBC5W.DLL, 4/4/2013
************************************************************************
create System DSN, named hp
using Unicode Driver
dsn=hp
descr=hp
tcpip server=192.168.1.11
user=root
password=xxxxx
Database=test
************************************************************************
ODBC Data Source Admin tool
far right tab called About
Admin, Control Panel, Cursor Library, Driver Mgr, Localized R DLL, Unicode Cursor Lib all Version 6.1.7601-ish
************************************************************************
MSFT Office Professional Plus 2010
Version 14.0.6129.5000 (64 bit)
VBA 7.0
Tools Menu / References / References - VBAProject, scroll down, click on:
Microsoft ActiveX Data Objects 6.1 Library
References Location= c:\program files\common files\system\ado\msado15.dll
************************************************************************
code same, get into an excel Macro:
Sub Macro1()
'
' Macro1 Macro
'
Dim oConn As ADODB.Connection
Dim rsPass As ADODB.Recordset
Dim sql As String
Set oConn = New ADODB.Connection
oConn.Open "hp"
Set rsPass = New ADODB.Recordset
sql = "select * from charlie1"
rsPass.Open sql, oConn
rsPass.Close
sql = "insert into charlie1 (billybob,birthdate,funny_num) values (5,now(),383.111)"
rsPass.Open sql, oConn
End Sub
Run Task Manager and look for EXCEL.EXE - most likely it has *32 after it (the issue is you are running a 32-bit version of excel, attempting to use the 64-bit version of MySQL Connector/ODBC).
To resolve:
Be sure to remove any defined ODBC data sources (DSNs) before
uninstalling the 64-bit driver (unable to remove if the driver is
already uninstalled)
Uninstall 64-bit MySQL Connector/ODBC driver
Download and install 32-bit version of MySQL Connector/ODBC driver
To setup DSN, see this http://forums.mysql.com/read.php?37,357786,360776#msg-360776
Note: You may be able to have both the 64-bit and 32-bit drivers installed and therefore not require uninstall of the 64-bit version. I did not need both so I haven't tested whether it is possible to have both installed.
I was recently fighting with this problem myself.
Taking advice from iOSdedude, I followed the link you originally posted, downloaded the 32-bit driver, and my ODBC connection started working again.
I am running Windows 7 on and my OS shows 64-bit under My Computer --> Properties --> System Info, so I was surprised to see that the 64-bit driver didn't work.
Not a good explanation as to why this works, but it worked for me.