1. go to the location you want to save exported file
    cd /var/www/ or wherever you would like to export the file
  2. Run this command; ask password – Put the MySQL password
    sudo mysqldump -u root -p db_name > db_export_file.sql
  3. Check the file location which we set in step 1


  1. Keep/Upload the sql file in the hosting server you would easily locate when you want to export
  2. Go to the location where you have uploaded the SQL file. cd /var/www or any other location you prefer
  3. Run this command; Once asked password – Put your MySQL password sudo mysql -u username -p dbname < dbexport.sql