How To Connect MySQL Database in Visual Studio

dbForge Fusion for MySQL is a Visual Studio add-in that offers you a visual, quick, and simple way to develop MySQL databases and to manage database connections using the Database Connection Manager window.

To access Database Connection Properties, use one of the following options:

  • Go to the Extensions > Fusion menu and select New Connection.

    Invoke the New Connetion menu from the Extensions > Fusion main menu

  • On the Database menu, click New Connection button on the Database menu Create New Connection

    Database menu

The Data Connection Properties - MySQL dialog box opens where you can configure MySQL connection properties in order to connect to the database.

Create a New Server Connection

To create a server connection, do the following:

1. On the Data Source tab, select a server to which you want to connect.

Data Source tab in the Database Connection Properties dialog box

2. On the Connection tab, enter the following information:

  • Host: Name (or IP address) of the computer that hosts the MySQL server.
  • Port (for the TCP/IP connection): Port number of the computer that hosts the MySQL server. The default port number is 3306.
  • User: Name of the MySQL user account.
  • Password: Password for the MySQL user account you’ve specified in the User field. If you want to save the password for future use, select Allow saving password check box.
  • Database: Name of the database you want to connect to. Alternatively, you can also select the database you want to connect to from the Database drop-down list.
  • Connection Name: Generated automatically. However, you can create a distinctive name for the new connection.

3. (Optional) On the Connection tab, assign a category for a new connection in the Document Category box.

Document category on the Connection tab

4. (Optional) To modify additional connection properties, click Advanced.

Advanced settings on the Connection tab

5. (Optional) To configure security properties, click Security. For example, you can set up either SSL or SSH security properties.

Security settings on the Connection tab

6. (Optional) To configure HTTP tunnel properties, click HTTP.

HTTP settings on the Connection tab

7. (Optional) To use an embedded server, click Embedded.

Embedded server settings on the Connection tab

8. On the Parameters tab, verify or change the parameters you have set by double-clicking the required field.

Verify parameters on the Parameters tab

9. (Optional) Click Test Connection to verify that you can connect to the database with the specified connection parameters.

10. To create the connection, click OK.

Connect to the database

The new connection appears in Database Explorer where you can start using it to create, update, and manage database objects and data in MySQL tables.