Linux system MySQL backup import and Export

Source: Internet
Author: User

Mysql Backup

If you are using a one-click Environment configuration for the Help center, the MySQL installation directory is/alidata/server/mysql, and if you install MySQL to a different directory, you will need to enter your MySQL full installation path.

Library backup You can perform the/alidata/server/mysql/bin/mysqldump-uroot-p password database name > backup name on the server. sql

Mysqldump The event table is not exported by default, there is a warning to execute this command-warning:skipping the data of table mysql.event. Specify the--events option explicitly.

If you need to export a MySQL event, you can perform a/alidata/server/mysql/bin/mysqldump-uroot-p password--events--ignore-table=mysql.event database name > Beifen.sql

Import and Recovery

If you need to import the. sql file that you exported on another server or that you backed up, you can execute the/alidata/server/mysql/bin/mysql-uroot-p password in the same directory as the backup. sql file MySQL < beifen.sql For import recovery.

You can also enter MySQL via the/alidata/server/mysql/bin/mysql-uroot-p password

Mysql>use database in the database that needs to import data;

Then use the source command to import the mysql>source/root/beifen.sql; Where/root/beifen.sql is the full path to the data backup file.

Linux system MySQL backup import and Export

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.