In the server, we use more MySQL databases. To ensure the security of data, we need to back up the database irregularly. Here we briefly review how to back up the MySQL database, and we need to use these common commands.
Back up the entire database:
Mysqldump - u [user name] - p [database name]>[file name]. sql
For example, if you want to back up a database named "test" and save it to a file named "test_backup. sql", run the following command:
mysqldump -u root -p test > test_backup.sql
Back up specific tables:
Mysqldump - u [user name] - p [database name] [table name]>[file name]. sql
For example, if you want to back up a table named "users" in a database named "test" and save it to a file named "users_backup. sql", run the following command:
mysqldump -u root -p test users > users_backup.sql
Here we try to back up the database with commands, which is more complete. If you use phpMyadmin to back up the database, it is easy to be incomplete.
Scan the code to follow the official account
Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge