4.16 MySQL Data Export Tool

MySQL for Visual Studio has a data export tool that creates a dump file for a MySQL database.

Figure 4.66 MySQL for Visual Studio Data Export Tool: Main Window

Screen capture of MySQL for Visual Studio Database Export Tool: Main Window

Creating a Dump of an existing MySQL Database

In order to open a new window for the MySQL Data Export tool, the user must create a new connection using the Server Explorer Window inside Visual Studio. Once the connection is established, a contextual menu can be opened by right clicking on the connection node. From the menu, choose the MySQL Data Export option. A new tabbed-window opens for the current connection. The user can select one or more databases to include in the dump.

Figure 4.67 MySQL for Visual Studio Data Export Tool: Connection Context Menu

Screen capture for MySQL for Visual Studio Database Export Tool: Connection Context Menu

Follow these steps to create a dump for the MySQL Databases:

  1. Select all the databases and their objects to be included in the dump.

    Figure 4.68 MySQL for Visual Studio Data Export Tool: Selecting a Database

    Screen capture for MySQL for Visual Studio Data Export Tool: Selecting a Database

  2. It is very important to select the desired settings for the dump: whether the dump will include the data, whether the insert operations will be logged in extended mode, and so on. In the main window of the MySQL Database Export tool are shown the basic options for the dump. Also, by clicking on the Advanced button, more specific options can also be selected.

    Figure 4.69 MySQL for Visual Studio Data Export Tool: Advanced Options

    Screen capture for MySQL for Visual Studio Data Export Tool: Advanced Options

  3. When the selection of the options is done, give a name to the result file that will be created. If no path is given for the result file, the default path to be used is My Documents under the user's folder.

    Figure 4.70 MySQL for Visual Studio Data Export Tool: Generating the Dump File

    Screen capture for MySQL for Visual Studio Data Export Tool: Generating the Dump File

  4. A filter can be applied on the list of schemas for the selected connection. With it, the user can easily locate the databases to be included in the dump.

    Figure 4.71 MySQL for Visual Studio Data Export Tool: Filtering the Schemas

    Screen capture for MySQL for Visual Studio Data Export Tool: Filtering the Schemas

  5. After selecting the options and the name for the dump file, the user can click the Export button, which generates the dump.

    Figure 4.72 MySQL for Visual Studio Data Export Tool: Viewing the Generated Script

    Screen capture for MySQL for Visual Studio Data Export Tool: Viewing the Generated Script

Each dump can have different settings. After configuring the dump operation, the settings can be saved into a setting file for later use. This file includes: the connection selected, the name of the file for the dump, and the database or databases and the objects selected for dumping. The file extension for the setting file is .dumps.

Figure 4.73 MySQL for Visual Studio Data Export Tool: Saving a Setting File

Screen capture for MySQL for Visual Studio Database Export Tool: Saving a Setting File

A saved setting file can be loaded into the MySQL Data Export tool by clicking the Load Settings button.

Figure 4.74 MySQL for Visual Studio Data Export Tool: Opening a Setting File

Screen capture for MySQL for Visual Studio Database Export Tool: Opening a Setting File