Easily Import and Export MySQL Databases on Linux servers

Source: Internet
Author: User

As the MySQL database is running on the website, the backup problem becomes increasingly prominent. You may not be able to import or export data when using phpMyAdmin to export or import data because of a large timeout file. The following describes how to solve the problem:

Tools/Raw Materials
    • MySQL, phpMyAdmin
STEP/Method

MySQL Database Export
Method 1: mysqldump command
Run the command:/usr/local/MySQL/bin/mysqldump-u username-P Database Name
If the database user name has a password, the system will prompt you to enter the password after executing the command. If the database user name does not have a password, delete the "-P" parameter in the command.
(Note: We recommend that you use the MySQL Root Account for operations, because some databases may have been set to only allow users to perform operations .)
Method 2: phpMyAdmin
PhpMyAdmin supports backing up database files directly to the directory specified in the configuration file. The lnmp installed by default uses the modified configuration, you can back up the database directly to/home/wwwroot/PHPmyAdmin/save/, and then download the database through HTTP or FTP. I have not tested a large database yet. lnmp users can test it and give me feedback.
Method 3: third-party software
For example, the Empire backup King is a stable and efficient Software specially designed for the backup and import of MySQL big data. The system uses volume-based backup and import to theoretically back up databases of any size. According to feedback from the Internet, the installation and use methods are good.

MySQL Database Import
Method 1: MySQL Command
Run the command:/usr/local/MySQL/bin/MySQL-u username-P database name <file name
The parameter is the same as that used by mysqldump.
(Note: The imported database name must already exist .)
Method 2: phpMyAdmin can import/home/wwwroot/PHPmyAdmin/upload/to the specified database, you can upload the database backup file to the/home/wwwroot/PHPmyAdmin/upload/directory for import.

Notes
    • We recommend that you use the MySQL Root Account to perform operations, because some databases may have been set to only allow users to perform operations.
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.