VS connects to MySQL | mysql-for-visualstudio installation

This part is a supplement to the previous article . Regarding how to add MySQL to the Visual Studio Service Explorer for simple logging. The tool that needs to be installed is mysql-for-visualstudio.

Why use mysql-for-visualstudio

When programming with Visual Studio, open the Server Explorer and the data connection option will appear.
Insert image description hereIf you right-click the data connection => Add connection, there is no MySQL database option, only the Microsoft family database. You need to install one at this time, and you mysql-for-visualstudiocan add the MySQL database.

I've already installed it here, so I'll cover it up.
Insert image description here

Install mysql-for-visualstudio

This tool mysql-for-visualstudiocan be downloaded from the official website. Here is the address:
https://downloads.mysql.com/archives/visualstudio/

Download interface: There is MySQL for Visual StudioInsert image description here

Of course, you can also MySQLInstallerdownload and install it in . But if you are like me and your installer cannot install it, it may be a version problem. You can only download and install it from the web page.

I can't install it here. I need to download and install it from the official address mysql-for-visualstudio above .
v1.2.6 cannot support 2019Insert image description here

In addition, pay attention to version issues!

If your VS is 2019 and above, be sure to download and install MySQL for Visual Studio 1.2.9 and above.
Insert image description here
For details, please read the official document 1 :

Insert image description here
After downloading, double-click the msi file and install it by default. The file is not large, so there is no need to consider changing the path.
Insert image description here
Then, when you open your installer, there will be mysql-for-visualstudio, which means the installation is successful.
Insert image description here

Add MySQL in VS Service Explorer

At this time, you open yours Visual Studioand you can add MySQL.
Insert image description here
Enter and connect as required.

The input here is the same as Navicat connecting to MySQL.
(It is the same as the parameters passed when creating a database connection Object in writing a program)
Insert image description here

After adding it, you can use VS to open and design the database table.
Take the database table I created as an testexample student:
Insert image description here
Here, you can manually design database tables and test SQL statements.

This graphical interface is very similar to Navicat.
Insert image description here


  1. https://dev.mysql.com/doc/visual-studio/en/visual-studio-install.html ↩︎

Guess you like

Origin blog.csdn.net/m0_67313306/article/details/130793442