RE: [PHP-DB] transferring data from one mySQL server to another?
| From: | John Guynn | Date: | Fri, 01 Sep 2000 18:28:13 +0000 |
| Subject: | RE: [PHP-DB] transferring data from one mySQL server to another? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2572@lists.php.net to get a copy of this message | ||
I do have telnet access to the remote server and my local server is Win2000
so command line is not a problem. Thanks...I mostly know how to make things
happen the way I want using PHP but I don't know mySQL that well...yet.
Guess it's time to hit the mySQL website and learn about the mysqldump
command.
John Guynn
-----Original Message-----
From: Cody Caughlan [mailto:codyc@cisco.com]
Sent: Friday, September 01, 2000 1:14 PM
To: John Guynn
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] transferring data from one mySQL server to
another?
Do you have access to the mysqldump command? Which is part of the normal
mysql installation..
If so,
you can do:
mysqldump DATABASE_NAME > backupfile.sql
and it will dump all the table structures and data (in INSERT
statements)
so then to read it in, you would just do:
mysql DATABASE_NAME < backupfile.sql
This is assuming you have telnet access to both hosts to run these
commands, if not, I am not really sure what you would do except build
all the table structures yourself and INSERT all the data (the above
process but manually..)
good luck
/cody caughlan
John Guynn wrote:
>
> I need to duplicate the data from one mySQL server (where my wife's domain
> is hosted) to another machine (under my control) for backup and possible
> relocation purposes.
>
> My biggest stumbling block is that I can't access either server remotely
> (ie. I have to log into both mySQL servers using localhost as the host
> name). I figure I can hard code the table building code without too many
> problems. I can get all the data from the current web server and get it
in
> an array (at least I think I can) and I should be able to pull the code
from
> the array and insert it into the server under my control. The part I
can't
> figure out is the in-between part. Should I run a PHP script on the
remote
> (to me) server to write the data to a file (I've never tried writting data
> with PHP), then ftp the file to me an run a PHP script locally to read in
> the data or is there a better way?
>
> Any suggestions will be greatly appreciated.
>
> John Guynn
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
Cody Caughlan -codyc@cisco.com- Cisco Systems
Web/Database Engineer phone: (408) 525-6029
Enterprise Line of Business pager: (408) 951-9949