2

I am trying to import my hosted mysql database to my local host database. I have the mysql program working on hosted domain but have unable to transfer to home server pc. Please let me know do I do it. thanks

NewbieDeveloper
  • 126
  • 2
  • 2
  • 10

2 Answers2

2

You would use the MySQL Workbench. Under the Server tab there are options for Data export and Data import. So, first you need to establish a connection with the remote host (at which point click on the Server tab) and export the data. Then make a connection with your local server and import the data.

ZuberFowler
  • 133
  • 8
1

Try this commands from terminal(Linux)

mysqldump -u username -pPassword -hHostName databasename > hostedDump.sql

Login to MySql and create the database by this command

Create database databaseName;

Then just import the dump into your database.

mysql -u userName -pPassword -h localhost < hostedDump.sql

For more reference visit mysql documentation for mysqldump.

Manish Verma
  • 771
  • 7
  • 20
  • 1
    Note: The lack of a space between -p and the mysql password is not a typo. However, if you leave the -p flag present, but the actual password blank then you will be prompted for your password. Sometimes this is recommended to keep passwords out of your bash history. – Manish Verma Jul 18 '14 at 04:18