In some cases, you need to back up the database and VPS you don’t use any control panel. Or you need to import the database, but the database is too large to a few hundred MB, this article will help you to backup and import the database on VPS quickly and simply.
1. BACKUP DATABASE
You perform the dump database with the following command
mysqldump --opt -u dotr_dotrungquan -p dotr_dotrungquan > filebackupdatabase.sql
Note:
- – u dotr_dotrungquan : database user
- – p dotr_dotrungquan : database name
- filebackupdatabase.sql : name of the backup file you want to save
- –opt : mysqldump options
After running the above command, the system will ask for the database password, enter the correct password
2. IMPORT DATABASE
After you have completed the database creation and saved the database information, including user data, username and password, you move to the directory containing the database that has been uploaded to the VPS and run the following command
mysql -u dotr_import -p dotr_import < filebackupdatabase.sql
Note:
- – u dotr_import : database user
- – p dotr_import : database name
- filebackupdatabase.sql : Name of the saved backup file (the backup file you want to restore)
- Hotline 24/7: 028 888 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: support@azdigi.com