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
2 Answers
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.
Comments
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.
1 Comment
Manish Verma
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.
mysqldump