MySQL for Visual Studio enables you to create, modify, and delete connections to MySQL databases.
To create a connection to an existing MySQL database, perform the following steps:
Start Visual Studio and open the Server Explorer by clickingand then from the main menu.
Right-click the Data Connections node and then click.
From the Add Connection window, clickto open the Change Data Source dialog, then do the following:
MySQL Databasefrom the list of data sources. Alternatively, you can select
MySQL Databaseis absent.
.NET Framework Data Provider for MySQLas the data provider.
Clickto return to the Add Connections dialog.
Type a value for each of the following connection settings:
localhostif the MySQL server is installed on the local computer.
The name of a valid MySQL database user account, such as
The password of the user account specified previously. Optionally, click Save my password to avoid having to enter the password for each connection session.
A default schema name is required to open the connection. Select a name from the list.
You can also set the port to connect with the MySQL server by clicking. To test connection with the MySQL server, set the server host name, the user name and the password, and then click . If the test succeeds, the success confirmation dialog opens.
Clickto create and store the new connection. The new connection with its tables, views, stored procedures, stored functions, and UDFs now appears within the Data Connections list of Server Explorer.
After the connection is successfully established, all settings are saved for future use. When you start Visual Studio for the next time, open the connection node in Server Explorer to establish a connection to the MySQL server again.
To modify or delete a connection, use the Server Explorer context menu for the corresponding node. You can modify any of the settings by overwriting the existing values with new ones. Note that the connection may be modified or deleted only if no active editor for its objects is opened: otherwise, you may lose your data.
Connections that use the X Protocol can be configured to use SSL with PEM files. To use SSL encryption, connections must be created using the MySQL Connections Manager included with MySQL for Visual Studio 2.0.3 (or later) or with MySQL Workbench.
SSL must be enabled in the target MySQL server instance and the X Plugin must be installed to support connections using SSL encryption and the X Protocol.
To create a connection to a MySQL database using SSL encryption and the X Protocol, perform the following steps:
Click the MySQL button () in Visual Studio Server Explorer to open the MySQL Connections Manager window.
Clickto create a new connection.
In the Parameters tab, add the host name, port, user name and password, and a default schema. Click to verify the connection information. The following figure shows an example of parameter values within this tab.
In the SSL tab, add a path to the SSL CA, SSL CERT, and SSL Key files within the SSL PEM area. Click to verify the connection information. The next figure shows an example of SSL PEM values within this tab.
Click MySQL Connections Manager window.to save the connection and return to theNote
You must close and then reopen MySQL Connections Manager to apply the default schema.