How to use Navicat to export and import *.sql files for MySQL database (taking Navicat Premium running and dumping SQL files as an example)


Preface

MySQL is the data we often use. It is very convenient whether it is used by developers for practice, small private server game servers, or personal software. For some personal assistant software, choosing MySQL database is a wise choice, and having a good tool is even more effective. Below I will show you how to use Navicat Premium to export and import *.sql data files.

Insert picture description here


1. Dump (export) database SQL files

Note : Dumping means exporting, and running means importing SQL files. There is no further explanation below.

1.1. Select "Dump SQL File"

Double-click the database to be exported, right-click the mouse, and select " Dump SQL File ", as shown in the figure below:

Insert picture description here

1.2, select the export file storage location

Select the storage location of the exported file and click Save, as shown in the figure below:

Insert picture description here

1.3, view dump SQL file interface

Check the dump SQL file interface, check the dump information, when the progress bar reaches 100%, we can click Close, dump the SQL file OK, as shown in the following figure:

Insert picture description here

1.4, view the SQL output file

Open the SQL output file location we just selected, mine is on the desktop, as shown below:

Insert picture description here

1.5, view the detailed information of the output file

If you need to view the SQL file details, we can use a text editing tool to open the SQL file just output, as shown in the following figure:

Insert picture description here

2. Run (import) database SQL file

For the convenience of the demonstration, I first go to my Navicat Premium and delete the database exported from the above demonstration.

Insert picture description here

2.1, create a new database

Note : Strictly speaking, what we exported from Navicat Premium above is not the database, but the data and structure of all the tables in the database. So, if you don't create a corresponding database, but just find a data to import, the result is just a few more tables just imported in this database.

To open Navicat Premium, we first need to right-click and select New Database, the name is the same as the name of the data we want to import, as shown in the following figure:

Insert picture description here

2.2, run the SQL file

After clicking OK, we can see the data we just created appear on the left, and then right-click and select "Run SQL File", a box will pop up, click "..." to select the path where the file is located, as shown in the following figure:

Insert picture description here
Insert picture description here

2.3. View and run the SQL file interface

Click start and import the SQL file we have on the desktop. When the progress bar reaches 100%, we can click close and run the SQL file OK, as shown in the figure below:

Insert picture description here

2.4. Check the SQL running file (why is my table imported?)

After importing the SQL file, please don't be alarmed if you can't see the tables in your database . What about my tables?
Insert picture description here

Please double-click your own database just now, then right-click-refresh, and then you can see the table.

Insert picture description here
Insert picture description here


to sum up

In this article, we have mastered how to use Navicat to export and import *.sql files for MySQL database. The rest of the IDE operations are similar. After mastering this technique, you can guide your classmates when you can't get the database, hahahahaha, just kidding. But please note that individual errors may occur when the versions are different. For example, if you import the same SQL file into your database, how many tables are missing? At this time, you need to pay more attention and check if your table file is enough. If it is not enough, do it again. If it still does not work, use a text editing tool to open the command interface and manually import the remaining tables. Programmers never give up!

Insert picture description here


I am Bailu, a programmer who works tirelessly. Hope this article can be of benefit to you, welcome everyone's one-click three-connection! If you have any other questions, suggestions or supplements, you can leave a message at the bottom of the article, thank you for your support!
More information WeChat search public accountWDeerCode code circle

Guess you like

Origin blog.csdn.net/qq_22695001/article/details/109265566