In this article I will explain a simple tutorial with example, how to download, install and reference the
MySQL Connector library in ASP.Net MVC.
Downloading MySQL Connector
You will need to download the Setup file of
MySQL Connector from the following link.
Installing MySQL Connector
1. After downloading, you will get the following mysql-connector-net-9.0.0.msi file as shown below.
2. Right click on it and click Install.
3. Simply click on Next.
4. You can browse the location where you want to save the
MySQL Connector.
5. After specifying location, click on Install Button.
6. Once the installation is completed, click on Finish Button.
Finally, navigate to the folder location (see step 4) where you have installed the
MySQL Connector.
Adding reference of MySQL Connector in ASP.Net MVC project
1. Inside the Solution Explorer, expand your project and right click on Reference of your Project and then click on Add Reference.
2. Then, inside the Reference Manager window, click on Browse button.
3. Navigate to the folder location (see step 4 – Installation section) where you have installed the
MySQL Connector and look for the
MySql.Data file and select it.
4. The MySql.Data DLL is now visible in the Reference Manager window. Select it and click OK button as shown below.
Finally, the MySql.Data DLL is now referenced and you can now use it in your project.