On Sat, 8 May 1999, Paul DuBois wrote:
> >> mysqldump connects to the server on torch and tells it to dump the contents
> >> of my_database. The dump output consists of SQL statements to create
> >> the tables in that database and populate them. That output gets piped
> >> to mysql, which connects to the server on pegasus. mysql reads its
> >> input, which creates and populates identical tables in the renamed_database
> >> database.
> >I hate to be a bug on the mailing list guys, but i want to get this right
> >and understand it.
> >Paul, so
> >mysqldump -u root -ppassword -htorch.blueznet.com my_database |
> >mysql -u root -ppassword -hpegasus.blueznet.com renamed_database
> >should work, as what you were saying in the previous post.
> >Both servers are connected and seeing each other. Your saying that
> >mysql will connect to pegasus.blueznet.com's mysql server without
> >setting any privileges, and recreate the database and populate it.
> >This db will be named the same as the one coming from torch.blueznet.com.
> >Just a little confused cause i was told to rename the database, and it has
> >to be named exactly like the original to work.
> Not quite. The output from mysqldump doesn't contain any reference to the
> name of the database you're dumping. That's why you name a database on the
> mysql command. That makes "renamed_database" the current database, so
> that any tables that are created are created in that database.
Thank You, this worked great! Moved 40+ megs and populated the db in a
matter of a minute, wow :)
Now i know the answer to this question!
> I forgot to mention -- you must create renamed_database on pegasus first,
> otherwise the mysql command will fail. Sorry about that. That's kind of
> important. :-)
> As far as setting privileges, that shouldn't be an issue if you connect
> as the MySQL root user and that user can do anything. To allow *other*
> users to use renamed_database after it's created, you'll need to set up
> privileges appropriately, of course.
Yes, i had to set privileges for root@stripped for it to
connect. It wouldnt connect on the first try.