[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-general
Subject:    Re: [PHP] Export MySQL
From:       Brad Pauly <brad () robinsontech ! com>
Date:       2003-12-31 18:58:31
Message-ID: 1072897111.2848.163.camel () earth
[Download RAW message or body]

On Wed, 2003-12-31 at 11:34, Sheawh wrote:
> it may be a bit out of topic,
> but can anyone teach me how to export a MySQL database?

If you mean in general, it is a bit OT, but check out mysqldump.

http://www.mysql.com/doc/en/mysqldump.html 

If you mean with PHP, you could use the exec() command
(http://us2.php.net/exec) with something like this:

$dbname = 'mydb';
$password = 'secret';
$username = 'myusername';
$filename = '/path/to/file';

exec("mysqldump --opt $dbname -u $username --password='$password' >
$filename");

- Brad

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic