That’s a heck of a title, but it’s a problem I hit recently. I have a bunch of ASP.NET sites that use MySQL as their datastore, but I hadn’t tried the on IIS7 yet. It took a while to get them to work at all (I had to set permissions on web.config and the other website files so that they could be read by both the Users group and the IIS_IUSRS group), but then I was left with an error about my MySQL connection. “ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified” – another very general error that basically means “Something is wrong with your ODBC driver, somewhere.”
After some searching, I learned two things. The first is that if you’re running 64-bit you can’t use the standard ODBC Data Source Administrator in Administrative Tools with MySQL. You’ve got to go to C:\Windows\SysWOW64\odbcad32.exe and set up your DSN, if that’s your thing. The other thing is that the MyODBC driver is 32-bit only. So to use it at all, you need to make sure you’re calling it from 32-bit apps only. That means you’ve got to tweak the Application Pool you’re using to run all its ASP.NET applications as 32-bit. To do this, go to Administrative Tools > Internet Information Services (IIS) Manager (or just hit the Windows key and type “IIS”). Then go to “Application Pools” and select whichever application pool your ASP.NET app uses (or create a new one just for your MySQL apps. Click “Advanced Settings…” and set “Enable 32-Bit Applications”. Now the AppPool will use the 32-bit .NET CLR to run your app, and it’ll be able to see your MyODBC driver (whether you use a DSN or not).

Hi… I’m tried it but I can’t fount this option in Windows XP x64.
How I can do it in XP x64 ?
Thanks. JR
Thanks!
’800a0e7a’ is defeated!!
I’ve spent days searching on google & microsoft.com and trying every resolution I found. Your article realy helps a lot!
Hi, Thanks Very much about your tip. I already knew about the first one, but the second, its the last I needed. So, congratulations about your help and I will recommend your site for all that are looking to solve a problem with Mysql ODBC driver connection with applications as ASP or ASP.NET websites.
REgards,
Thiago
Tritech Informatica – Consultoria e Desenvolvimento de Solucoes em Ti.
Dang, that was too easy! Why isn’t this published elsewhere!!!
great stuff, I got suck with this 4 an hour too.
Agree with Kevin. Hours wasted when the solution was so simple. Thanks so much!!!
Thanks a lot! I was searching this problem’ s answer for hours… I did everything which i saw on internet but your’ s the one which worked abselutaly!
Thank you so much… Really. You are a god.
[...] is a 32-bit app, you’ll need to set your app pool to run in 32-bit mode. I’ve already written one blog post on this (to get MySQL working with ASP.NET), and the instructions are the same. Basically open up the app [...]
Great article!! It works fine on Vista Ultimate x64!
Now am I lucky!
That really worked out after many trials found on other websites. Thanks a bunch!
Thank you so much, been struggeling for several hours!
Kind Regards
Fredrik
Thank you so much for this, was banging my head over this for about a week.
I’ve got it solved for Microsoft Visual Studio 2005 –> Running on Window 7 (64 bit)
1. Go to your Project’s property page.
2. In ‘Compile’ tab
3. Under ‘Advance Compile Options….”
4. Check for ‘Target CPU’ at the bottom.
5. Select x64 and click OK.
Boom !! Your application is on Air now :)