Easy way to back up MySQL database from command line
Steps by Step
-
Open command prompt window; Windows + R ; type cmd
- Copy the below line fully
- mysqldump -u root -p -h localhost yourdbname >dbbackfilename.sql
- Right click on command window and paste it; press enter key
- It will ask for password; press enter key again and wait for a second
- Your backup file is generated under C:\Windows\System32\subs_mBackup.sql folder
Trouble Shooting:
-
If above method returns “Access Denied” or any error please use below checks
- Open command prompt ; Windows key + R ; copy & paste below line and press enter
- cd C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin
- Now follow step 3 in Step by step section.