export from online to local

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
razstec
Posts: 5
Joined: 09 Mar 2012 09:13

export from online to local

#1 Post by razstec » 23 Oct 2015 11:23

Hi, i need some help creating a batch file that allows me to import a db from mysql online server to my local server in my computer.

Have tried some code that i google but i cant seem to work it out.

Code: Select all

mysqldump -u [root] -p [pobd] > [pobd.sql]  ----> export
mysql -u [root] -p [pobd] < [pobd.sql]  ----> import


Got this but how can i specifie that the export is from an online server and the import is to the local server?

Can anyone help?

thanks

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: export from online to local

#2 Post by Squashman » 23 Oct 2015 12:25

Could have sworn I saw this exact question asked on StackOverFlow the other day. I do not think we have too many MySQL experts here.

EDIT: Found it.
http://stackoverflow.com/questions/3328 ... with-batch

razstec
Posts: 5
Joined: 09 Mar 2012 09:13

Re: export from online to local

#3 Post by razstec » 23 Oct 2015 13:46

Yes your right.

I dont need the mysql, i need to know how to connect to server with batch file.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: export from online to local

#4 Post by Squashman » 23 Oct 2015 13:52

razstec wrote:Yes your right.

I dont need the mysql, i need to know how to connect to server with batch file.

No. You need to know how to connect to the server with the mysqldump command.
The link I gave you has another link that explains all that.
http://stackoverflow.com/questions/8444 ... mysql-dump

razstec
Posts: 5
Joined: 09 Mar 2012 09:13

Re: export from online to local

#5 Post by razstec » 26 Oct 2015 04:02

Cool, thanks

Post Reply