You are here: Home » Programming & Computer » MySQL » Backup Database from Hosting Site into Local Drive using Command Prompt

Backup Database from Hosting Site into Local Drive using Command Prompt

1,187 views

This article will show you the step by step how to backup database into local drive ( C: ) from hosting site (shared-hosting) using command prompt:-

1. Get your Dedicated IP Address from your cpanel

Image1: Highlighted text is your dedicated IP address from cpanel side navigation bar
2. Locate for mysqldump.exe from local drive. You can find the mysqldump.exe located at bin folder (eg: C:Program FilesMySQLMySQL Server 5.0bin).
3. Open your command prompt. (Start > Run > type in cmd > press OK)
4. Type in cd C:Program FilesMySQLMySQL Server 5.0bin and press Enter

Image2: Command Prompt (you are not required to change your localdrive to H: as shown in the image due to my localdrive had pre-set to H:)
5. Type in:-
mysqldump -h 123.1.12.12 -u your_db_adminusername -p your_db_databasename > C:save_to_filename.sql
Then press Enter
6. It will then prompt you to Enter your password:-
Enter password: keyin_your_database_pwd
Then press Enter
7. That’s it! you can find the backup copy of your database (text file with .sql ext) from C Drive ( C: ).

Additional Notes:
If you encountered an error messages as below:-

mysqldump: Got error: 1045: Access denied for user ‘your_db_adminusername’@’your_local_ip_address’ (using password: YES) when trying to connect

The possible reasons are numerous:-
1. Wrong password been entered.
2. You did not grant access by changing the setting in “Remote Database Access Hosts” in your cpanel.

Share

3 Comments

  1. Coffee is no a big deal la 🙂 Maybe I’ll switch hosting if this hosting give me a headache again. Then I go to you personally 🙂 Thanks yea for sharing the tips 🙂

  2. Yea, very easy to backup all your pages, posts including your database and load it into new hosting server (Just used the import under the Tool tab from your wordpress). But I need to remind you first, your themes and all the plugins need to move it as well, upload and then activated when you had moved into new hosting folder. Also, you need to identify either your hosting company is using Softaculous or Fantastico to ease up your task to move from wordpress free host into private hosting. I actually want to ask you buy me a coffee and teach you personally one…. but since you so support my blog…. OK la…. share share with you anytime you want 😉

  3. Hi there!~ Waa! A good effort in PHP! Can learn but I’m a slow learner 😛 BTW is possible to backup my blog including database and load it on new hosting? Hard to do or not? playing with SQL, make me dizzy with little knowledge of mine.

Leave a Reply

Your email address will not be published. Required fields are marked *