Webbstackar

Webbstackar

.NET to MySQL

MySQL 5.6 Manual - Chapter 22. Connectors and APIs:
http://dev.mysql.com/doc/refman/5.6/en/connectors-apis.html

ODBC Driver for MySQL (Connector/ODBC)

http://dev.mysql.com/downloads/connector/odbc/
mysql-connector-odbc-5.2.6-win32.msi
mysql-connector-odbc-5.2.6-winx64.msi
mysql-connector-odbc-noinstall-5.2.6-win32.zip
mysql-connector-odbc-noinstall-5.2.6-winx64.zip

Older version: http://dev.mysql.com/downloads/connector/odbc/3.51.html
mysql-connector-odbc-3.51.30-win32.msi
mysql-connector-odbc-3.51.30-winx64.msi
mysql-connector-odbc-noinstall-3.51.30-win32.zip
mysql-connector-odbc-noinstall-3.51.30-winx64.zip

Installing Connector/ODBC on Windows:
http://dev.mysql.com/doc/refman/5.6/en/connector-odbc-installation-binary-windows.html

ADO.NET Driver for MySQL (Connector/NET)

Windows (x86, 32-bit), MSI Installer (mysql-connector-net-6.7.4.msi):
http://dev.mysql.com/downloads/connector/net/

.Net & Mono (Architecture Independent), ZIP Archive (mysql-connector-net-5.2.7-noinstall.zip):
http://dev.mysql.com/downloads/connector/net/5.2.html

Installing Connector/Net on Windows:
http://dev.mysql.com/doc/refman/5.6/en/connector-net-installation-windows.html

Install connector(s) & configure System-DSN on Windows 7

32-bit connectors/drivers:

On the computer running the webserver:

Download and run mysql-connector-odbc-5.2.6-win32.msi
Download and run mysql-connector-net-6.7.4.msi

Start odbcad32.exe:

On a 64-bit Windows 7 system: Open Command Prompt and run the following command:

%windir%\SysWOW64\odbcad32.exe

On a 32-bit Windows 7 system: Open Command Prompt and run the following command:

%windir%\System32\odbcad32.exe

Once odbcad32.exe is up and running, proceed with the following steps:

Click the System-DSN tab
Click the Add... button
Click MySQL ODBC 5.2 ANSI Driver to select that driver
Click Exit

In MySQL Connector/ODBC Data Source Configuration window, Connection Parameters section:

In the Data Source Name field, type in name for your data source (in this case MySQL). The Data Source Name is like a label for the Data Source and is only used in odbcad32, not in connection strings, so you can name the Data Source to something descriptive like PCNAME_MySQL.

In the TCP/IP Server field, type in the name of the computer on which the MySQL server is running. If the MySQL server is running on the same computer on which you're setting up System-DSN, use the name localhost.

In the Port field, type in the port number of the port on which the MySQL server listens for connections. The default port number is 3306 and used in most cases. The port number 3306 should already be selected for this field. If it is, leave the field as is unless you know MySQL listens for connections on another port.

In the User field, type in the name of the MySQL user that should be used by the webserver connections to the MYSQL database.

In the Password field, type in the MySQL server password for the MySQL user you specified in the User field above.

In the Database field, type in the name of the MySQL database to which webserver connections are to be made.
If the MySQL server is running on the same computer on which you're setting up System-DSN, use the down arrow to display a dropdown menu of the MySQL databases available and select the one to which webserver connections are to be made.

On a 64-bit Windows 7 system: You also need to set DefaultAppPool in IIS to enable 32-bit applications.

Click the Windows 7 Start button.

Click Run...
Type inetmgr in the Open: textfield and click OK.

OR

Click Control Panel.
Click System and Security.
Click Administrative Tools.
Double-click Internet Information Services (IIS) Manager.

Internet Information Services (IIS) Manager starts and the Internet Information Services (IIS) Manager window opens. Proceed by doing this:

Click the server name to select it and then stop the server by clicking Stop in the right pane.

Expand the server and click Application Pools

Click DefaultAppPool to select it.

Click Advanced settings in the right pane.

Set Enable 32-bit applications to True.

Click OK.

Click the server name to select it and then start the server by clicking Start in the right pane.

64-bit connector/driver:

On the computer running the webserver:

Download and run mysql-connector-odbc-5.2.6-winx64.msi

Open Command Prompt and the following command:

%windir%\System32\odbcad32.exe

Click the System-DSN tab
Click the Add... button
Click MySQL ODBC 5.2 ANSI Driver to select that driver
Click Exit

In MySQL Connector/ODBC Data Source Configuration window, Connection Parameters section:

In the Data Source Name field, type in name for your data source (in this case MySQL). The Data Source Name is like a label for the Data Source and is only used in odbcad32, not in connection strings, so you can name the Data Source to something descriptive like PCNAME_MySQL.

In the TCP/IP Server field, type in the name of the computer on which the MySQL server is running. If the MySQL server is running on the same computer on which you're setting up System-DSN, use the name localhost.

In the Port field, type in the port number of the port on which the MySQL server listens for connections. The default port number is 3306 and used in most cases. The port number 3306 should already be selected for this field. If it is, leave the field as is unless you know MySQL listens for connections on another port.

In the User field, type in the name of the MySQL user that should be used by the webserver connections to the MYSQL database.

In the Password field, type in the MySQL server password for the MySQL user you specified in the User field above.

In the Database field, type in the name of the MySQL database to which webserver connections are to be made.
If the MySQL server is running on the same computer on which you're setting up System-DSN, use the down arrow to display a dropdown menu of the MySQL databases available and select the one to which webserver connections are to be made.