Hello,
I am attempting to add a MySQL database connection to the Database Explorer and am running into some issues. I have spent the last 5 hours researching and trying different solutions without success. Below are the steps that I have taken. Any help will be much appreciated.
- Downloaded and installed ADO. NET Driver for MySQL (Connector/NET) 6.0
[LIST] - Added Reference to MySQL. VisualStudio. dll
- Went to database explorer, selected Add Connection
- neither MySQL Database nor . NET Framework Data Provider for MySQL were available
- Failed to add database
[/LIST] - removed reference to MySQL .VisualStudio. dll and Added Reference to MySQL. Data. dll
[LIST] - Followed steps above to connect to database…still no MySQL available
- Removed reference to MySQL. Data. dll
[/LIST] - Attempted to add ODBC datasource
[LIST] - Clicked Add Connection
- Selected Microsoft ODBC Data Source
- Selected . NET Framework Data Provider for ODBC & clicked Continue
- Selected Use Connection String
- Added: DRIVER={MySQL ODBC 3. 51 Driver}; SERVER=mysql . mysqlhost . com; PORT=3306;DATABASE=dbName; USER=userName; PASSWORD=passWord; OPTION=3; (with the actual values added for mysql host, database, etc…)
- Received error: ERROR[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
[/LIST] - Downloaded MySQL Connector ODBC 5.1
[LIST]Followed above steps again under Add ODBC Datasource. again, unsuccessful
[*]Opened Data Sources (ODBC) in my system (Vista)
- in ODBC Data Source Administrator, Selected System DNS tab
- Clicked Add…
- Selected MySQL ODBC 5.1 Driver
- Added the following:
[LIST] - Data Source Name: MySQL DataSource
- Description: MySQL connection to dbName
- Server: mysql. mysqlhost. com Port: 3306
- User: userName
- Password: passWord
- Database: dbName
[/LIST] - Clicked test and received error - Connection Failed: [HY000][MySQL][ODBC 5.1 Driver]Unknown MySQL server host ‘mysql. mysqlhost. com’ (11004)
- I verified connection information and it was correct
- I tested credentials with a PHP database connection script and connected successfully, so the error doesn’t make sense considering the server host was found by PHP.
[]Added User Data Source using same as above and received same error
[]finally, tried to add the connection directly to the web. config file
- Tried adding it both for the mySQL. data. dll and without:
<remove name=“LocalMySqlServer”/>
<add name=“MySQL_ConnectionString” connectionString=“SERVER=mysql. mysqlhost. com; PORT=3306;DATABASE=dbName; USER=userName; PASSWORD=passWord; OPTION=3;” />
[/LIST]
My overall goal is to be able to add a MySQL database to the Database Explorer to allow me to Build a Data Access Layer via datasets for reference in my web site. I’ve read through a ton of forums/posts and also this site (dev. mysql. com/doc/refman/5.0/en/connector-net-installation. html) but haven’t found a solution.