MySQL import and export a large amount of data, backup recovery method

Source: Internet
Author: User
Tags mysql import

Friends who often use php+mysql are generally managed by phpMyAdmin to manage the database. Some daily debugging development work, the use of phpMyAdmin is really convenient. But when we need to export hundreds of trillion or even a few g of the database, phpMyAdmin will be very card. Even if you want to import large amounts of data, phpMyAdmin is completely unable to complete. Because phpMyAdmin is based on a PHP Web page, it is not possible to upload too large SQL files. In fact, MySQL official gave us a good solution: mysqldump.

Here's how to export a database in a Windows environment using mysqldump:

    1. Find your MySQL installation directory, which is the directory where Mysqldump.exe resides. For example, the path on my computer:

    2. In the space, hold down the SHIFT key and right-click and select Open Command Line window here.

    3. After you start the command line, enter

      Mysqldump-h localhost-u Root "database user name"-p--opt--default-character-set=utf8--hex-blob icenter "database name to export"-- Skip-triggers > D:/icenter.sql "Export Path"
    4. After executing the above command, you can export the SQL file. No matter how large your database is, you can export it using this method.

The command to import the database is as follows:

Mysql-h localhost-u rufavor-p Icenter < D:/icenter.sql

The Run method is similar to the above export. Similarly, in a Linux environment, you can also use mysqldump to export imported data.

Original address: MySQL import and export a large amount of data, backup recovery method

MySQL import and export a large amount of data, backup recovery method

Related Article

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.