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
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.