MYSQLをPHPからDUMPする方法
PHPからテーブル単位でDumpできて、圧縮までできちゃううぐれもの
MYSQLDumpをダウンロード
http://www.coders4fun.com/en/category/mysql/
//Include the library
@include_once('lib_dump.php');
//Db connection
$connection = @mysql_connect('127.0.0.1','username','password');
//Create the MySQLDump class instance
//1° parameter: db name
//2° parameter: the exported file that will contain the dump
//3° parameter: create zipped file (true = zipped, false = normal)
//4° parameter: data encode (true = hexadecimal, false = plain text)
$dumper = new MySQLDump('mydb','dumpfile.sql',false,false);
//Structure export of the table 'mytable'
$dumper->getTableStructure('mytable');
//Data export of the table 'mytable'
$dumper->getTableData('mytable');
$connectionの127.0.0.1はlocalhostにする必要があるかも
- [2008/11/21 03:56]
- Memo |
- Trachbacks(0) |
- Comments(0)
- Post's URL |
- TOP ▲
Trackbacks
この記事のトラックバックURL
→http://flamberge12.blog43.fc2.com/tb.php/35-251ae680
- | HOME |




Post a comment