Re: mysql db dump with php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 17 November 2004 13:51, Nate Nielsen wrote:

> i need a script that will connect to a db with a username and password, and
> then export to the screen scripts to both recreate the database structure
> (the create table commands) and then create insert statements to populate
> that information into the database.  then of course, i need to run those
> scripts on the other server to create the db and populate it.

>From the command line of the system holding source database:

  mysqldump --opt -u username -p password nameofdatabase > nameofdatabase.sql

Now take the created file nameofdatabase.sql and place onto the system holding 
destination database. Then from the command line of the system holding 
destination database:

  mysql -u username -p password < nameofdatabase.sql

If you don't have direct access to the command line use php's program 
execution functions.

> if you can hook me up i'll paypal you $20 bucks to buy you and yours a few
> pints of your favorite ale on me.

Donate it to your local Red Cross/Red Crescent or equivalent.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
------------------------------------------
/*
Logoff in progress...
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux