Re: Export MySQL
| From: | Brad Pauly | Date: | Wed, 31 Dec 2003 18:58:31 +0000 |
| Subject: | Re: Export MySQL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-173573@lists.php.net to get a copy of this message | ||
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