At 8:21 AM -0500 5/8/1999, Darrell Shifflett wrote:
>On Sat, 8 May 1999, Orlando Andico wrote:
>> On Sat, 8 May 1999, Darrell Shifflett wrote:
>> > question: I would like to know the safest way to move my databases i have
>> > created on existing box to the new box. I know i can tar cvfz
>> > the db's and just ftp them to the /var/lib/mysql directory.
>> > But! will db's from an older version be compatable with the new
>> > version? Basically, im moving everything from one server to
>> > another. I presume the mysqld daemon will have to be restarted.
>> mysqldump -uroot -pXXXX -hOLDSERVER NAME_OF_DATABASE | \
>> mysql -uroot -pYYYY -hNEWSERVER NAME_OF_NEW_DATABASE
>We trying to do this?
>mysqldump -u root -p 'password' -h 'torch.blueznet.com' my_database |
>mysql -u root -p 'password' -h 'pegasus.blueznet.com' renamed_database
>So where does this come in as getting it to the new server?
>Could you clarify this command and what exactly its doing please?
>Once this is done is it then sent to the directory where /var/lib/mysql
>resides? Im running RH 5.2 and thats the default directory.
If you compare the command you're using with the one that was suggested,
you will notice that there is no space after the -p options in the suggested
command, and there is a space after the -p options in the command you
are using. If that's really how you are typing the command it will
fail because -p and the password must be given with no intervening space.
Assuming you can get the command to work as you want, this is what happens:
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
Paul DuBois, paul@stripped
Northern League Chronicles: http://www.snake.net/nl/