Nano
Nano

Reputation: 196

Backup mysql database from live server to my local MySQL

I develop a good website on my local computer, lets called Site A. I have packed them and put to live server which host by hosting company.

Now.. I would like to take database from Site A (live server) to my Site A database that I manage on my PC localhost.

Is there any command line work to update my Site A Database (development area) with current data table from Site A on live server?

Upvotes: 1

Views: 2000

Answers (2)

CS GO
CS GO

Reputation: 912

first from remote server in terminal/cmd:

mysqldump -u [username] -p[password] [dbname] > [backupfile.sql]

after that in local machine terminal/cmd:

mysql -u [username] -p [password] [dbname] < [backupfile.sql]

Upvotes: 1

sergio
sergio

Reputation: 5260

First, if you have access to remote DB, using command line and fetch the remote database, you can do something like this:

cd "mysql_directory"

after, do

mysqldump -u username -p -h host_ip DATABASE_TO_MIRROR >c:\backup\database.sql

Upvotes: 1

Related Questions