Easily import and export MySQL databases on LinuxVPS/server

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: MySQL database export Method 1: mysqldump command execution command:/usr/local/

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:

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 <文件名< p>

The parameter is the same as that used by mysqldump.

Note: The imported database name must already exist.

Method 2: phpmyadmin

Phpmyadmin can import the data in/home/wwwroot/phpmyadmin/upload/to the specified database, and upload the database backup file to the/home/wwwroot/phpmyadmin/upload/directory for import.

Method 3: third-party software

Example: Empire backup King

 

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.