How to generate a MySQL backup using mysqldump
1. Access the server via SSH
ssh user@your_server

2. Run the command to generate the backup
mysqldump -u user -p database_name > backup.sql
-
user → MySQL username
-
database_name → the database you want to export
-
backup.sql → the name of the file that will be generated
.webp)
-
After running the command, the terminal will ask for the MySQL password.
Type it and press Enter. -
Important: nothing will appear while typing the password — this is normal.
3. Wait for the process to finish
The command will generate the backup.sql file in the same directory where it was executed.
4. Download the file to your local machine (optional)
If you want to copy the backup to your local machine, use:
scp user@your_server:/path/backup.sql .
-
Replace /path/backup.sql with the correct path where the file was saved.
-
The final dot (.) indicates that the file will be downloaded to the current directory.