To back up a MySQL database, you can use the mysqldump command. Here’s the syntax:
mysqldump -u username -p database_name > backup_file.sql
Replace username with your MySQL username, database_name with the name of the database you want to back up, and backup_file.sql with the desired name for your backup file.
After running the command, you will be prompted to enter your password. This will create a .sql file containing all the SQL commands needed to recreate the database.
