How to use Navicat to export and import mysql database

How to use Navicat to export and import mysql database

MySql is a data source we use frequently. It is very convenient for developers to use for practice, small private game servers, or personal software. For making some personal auxiliary software, choosing MySQL database is a wise choice. Having a good tool can make you get twice the result with half the effort. For MySql IDE, I recommend Navicat for MySql. Now I will introduce to you how to use Navicat for MySql to export and import data.

Export the database:

Open Navicat, right-click the mouse on the data we want to export, and then click "Dump SQL File" on the shortcut menu that pops up, 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 save location. After selecting the location, click OK.

Import the database:

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

After clicking OK, we can see the data we just created appear on the left, then right-click and select "Run SQL File" and a box will pop up. Click "..." to 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 tables in the database. Therefore, if you do not create a corresponding database, but import data randomly, the result is that this database will have several more tables that have just been imported.

PS: Summary of mysql database import and export methods

General format: mysqldump -h IP -u username -p database name > exported file name

(1) You cannot add a password after -p. You can only enter it alone as in 1. (2) mysqldump is a command under cmd. It cannot be used under mysql. That is, you cannot enter mysql (that is, use dpname. You must exit mysql to do so.)

1: Database export (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.sql
mysqldump -h 10.180.6.183 -u root -p dmsdev > D:\imssdb\20170930\dmsdev20170930.sql
mysqldump -h 10.180.6.183 -u root -p newfwk > D:\imssdb\20170930\newfwk20170930.sql
mysqldump -h 10.180.6.183 -u root -p dcsdev > D:\imssdb\20170930\dcsdev20170930.sql

2: Database import (restore)

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

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

create database abc; (create database)

show databases; (You can see all existing databases and the database abc just created)

use abc;(enter the abc database)

show tables; (show all tables under the abc database, empty)

source G:\arcgisworkspace\zypdoc\test.sql (import database table)

show tables; (view all tables under the abc database, and you can see the table)

desc pollution;(see table structure design)

select * from pollution;

exit (or ctrl + c) to exit mysql

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed explanation of MySQL command line export and import database instance
  • Steps to import mysql database under wampserver
  • MySQL command line export and import database
  • Modify php.ini to implement the maximum limit of Mysql import database file modification method
  • Windows cannot start MySQL service and reports error 1067 solution
  • mysql service cannot start and reports error 1067 solution (mysql startup error 1067)
  • When MySQL is upgraded to 5.7, WordPress reports error 1067 when importing data

<<:  Zabbix monitors the process of Linux system services

>>:  Win10 install Linux ubuntu-18.04 dual system (installation guide)

Recommend

A brief discussion on the difference between src and href in HTML

Simply put, src means "I want to load this r...

Tutorial on installing jdk1.8 on ubuntu14.04

1. Download jdk download address我下載的是jdk-8u221-li...

Summary of xhtml block level tags

* address - address * blockquote - block quote * c...

Some data processing methods that may be commonly used in JS

Table of contents DOM processing Arrays method Su...

Web Design Tutorial (8): Web Page Hierarchy and Space Design

<br />Previous article: Web Design Tutorial ...

How to use mysql to complete the data generation in excel

Excel is the most commonly used tool for data ana...

Detailed usage of Vue more filter widget

This article example shares the implementation me...

The difference between where and on in MySQL and when to use them

When I was writing join table queries before, I a...

How to use docker to deploy dubbo project

1. First, use springboot to build a simple dubbo ...

Solution to the cross-domain problem of SpringBoot and Vue interaction

Table of contents Browser Same Origin Policy 1. V...

Specific use of pthread_create in linux to create threads

pthread_create function Function Introduction pth...

WeChat applet implements fixed header and list table components

Table of contents need: Function Points Rendering...

How to implement the jQuery carousel function

This article shares the implementation code of jQ...