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 tools and Command Line to implement Export and Import backup in mysql Database

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

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains the "mysql database how to use tools and command line to achieve export import backup", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "mysql database how to use tools and command line to achieve export import backup" bar!

I. tool export and import

There are many MySql tools, such as MySql Administrator, Navicat, and SQLyog. Here we take MySql Administrator as an example.

Export:

Open MySql Administrator, click Backup on the left, click New Project in Backup Project, enter Project Name, select the database to be backed up from the left to the right, then you can select the data table to be exported, and finally click Execute Backup Now. In addition, advanced backup parameters can be selected in Advanced Option and scheduled backups can be made in Schedule.

Import:

Open Backup File,Target Schema select Another schema in Restore and find the database you want to import, and click Start Restore

Command line export and import

Although various tools are convenient to export and import, they are prone to problems that do not support backup files exported by other tools. So it is also necessary to learn how to export and import from the command line. The following command is used only if the command has been added to the path of the system or the directory has been changed to the mysql\ bin directory

Export:

Command mysqldump-h hostName-u userName-p databaseName > backupFileName.sql

HostName is the connection address after-h (local machine is omitted), userName after-u is the user name,-p represents login with password, databaseName is the database name to be exported, and backupFileName is the backup file name.

For example, mysqldump-u root-p stateOnline > statedump.sql

Enter the password when prompted to enter the password, Enter password:, enter the password, and then export it later.

Import:

Command mysql-h hostName-u root-p databaseName < backupFileName.sql

HostName after-h is the connection address (omitted as the local machine), userName after-u is the user name,-p represents login with password, databaseName is the name of the database to be imported, and backupFileName is the backup file name.

For example, mysql-u root-p stateoffline < statedump.sql

Enter the password when prompted to enter the password, Enter password:, enter the password, and then import it later.

Thank you for your reading, the above is the "mysql database how to use tools and command line to achieve export import backup" content, after the study of this article, I believe you on the mysql database how to use tools and command line to achieve export import backup this problem has a deeper understanding, the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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