How to backup mysql database from command line?

Easy way to back up MySQL database from command line

Steps by Step 

  1.  Open command prompt window; Windows + R ; type cmd  
  2. Copy the below line fully 
  3. mysqldump -u root -p -h localhost yourdbname >dbbackfilename.sql
  4. Right click on command window and paste it; press enter key
  5. It will ask for password; press enter key again and wait for a second
  6. Your backup file is generated under C:\Windows\System32\subs_mBackup.sq folder
          

Trouble Shooting: 

  1.  If above method returns “Access Denied” or any error please use below checks
  2. Open command prompt ; Windows key + R ; copy & paste below line and press enter
  3.  cd  C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin 
  4. Now follow step 3 in Step by step section.

Published by arjunpremier

Software Engineer, Blogger,

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Design a site like this with WordPress.com
Get started