Forum Moderators: mack
I want to grab a database from my local Win2k machine and paste it into my hosts mysql database.
After logging into telnet w/ username and password- is this the prompt where I need to enter:
mysqldump --host=host1 --opt mydatabase ¦ mysql --host=host2 -C newdatabase
-------------------------------------------
This gives a lovely little 1064 error. Am I in the correct place here (in telnet)?
I'm really guessing here, but since you havn't had a reply I thought I'd try -
I'm not sure you need to specify both hosts. I would have thought that the way to do this would be to run the command on the command line of the first host machine (the one you're copying hte database from) and then just specify the host for the second one (the one you're copying to).
I'm basing this on the following line from the MySQL docs:
mysqldump --opt database ¦ mysql --host=remote-host -C database
also, is the new databse already created beforehand on the destination host?
Yes, the new database is already created. I just got phpMyAdmin and was working with it a bit. I believe the export function exists to create a mysqldump- which I did use and it created the dump file- but never asked for the destination database. So that's the part I'm trying to figure out. I haven't had success with it manually either.
The thing that gets me is it seems that this is probably one of the easiest things to accomplish in php/sql. Probably is but until ya see it.
mysql database < backup-file.sql
from the telnet prompt
This will create your tables and their structures automatically, you just need the database created.
you probably already know this though :)