Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Navicat to export and import database in mysql

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

MySql is the data that we often use, whether it is used by developers to practice, or small private game servers, or personal software, are very convenient. For some personal assistant software, choose mysql database is a wise choice, there is a good tool is twice the result with half the effort, for MySql IDE I recommend Navicat for MySql, now I will show you how to use Navicat for MySql to export and import data.

Export the database:

Open Navicat, right-click the data we want everywhere, then click "dump SQL File" on the pop-up shortcut menu, and select the first "data and structure" in the submenu item that pops up again.

Then, a save box will pop up to select the location to save. After selecting the location, click OK, and OK it.

Import the database:

Open Navicat for MySQL, then right-click and select New Database with the same name as the data we want to import.

After clicking OK, we can see the data we just created on the left, and then right-click and select "run SQL File" will pop up a box and click "..." Select the path where the file is located

Click start and the file will be imported successfully!

Strictly speaking, what Navicat for MySQL exports 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 choose a random data import, the result is that the database has several more tables that have just been imported.

Summary of Import and Export methods of PS:mysql Database

General form: mysqldump-h IP-u user name-p database name > exported file name

(1)-p cannot be followed by password, but can only be entered separately as in 1. (2) mysqldump is a command under cmd and cannot be entered under mysql, that is, it cannot enter mysql (that is, under use dpname, only if exit exits under mysql. )

One: export of database (backup)

0: (backing up the database means exporting all tables and data without adding-d)

Mysqldump-h localhost-u root-p test > G:\ arcgisworkspace\ zypdoc\ test.sqlmysqldump-h 10.180.183-u root-p dmsdev > D:\ imssdb\ 20170930\ dmsdev20170930.sqlmysqldump-h 10.180.183-u root-p newfwk > D:\ imssdb\ 20170930\ newfwk20170930.sqlmysqldump-h 10.180.183-u root-p dcsdev > D:\ imssdb\ 20170930\ dcsdev20170930.sql

Second: import (restore) of database

0: import the database (first create the data, then import) C:\ Program Files\ MySQL\ MySQL Server 5.5\ bin >

Mysql-h localhost-u root-p (enter under mysql)

Create database abc; (create database)

Show databases; (you can see all the existing databases, as well as the database abc you just created)

Use abc; (go to the abc database)

Show tables; (see all tables under the abc database, empty)

Source G:\ arcgisworkspace\ zypdoc\ test.sql (import database tables)

Show tables; (look at all the tables under the abc database and you can see the tables)

Desc pollution; (view table structure design)

Select * from pollution

Exit (or ctrl + c) exits mysql

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report