|
发表于 2012-3-23 00:52:56
|
显示全部楼层
命令行连接
include APPPATH.'config/database.php';
$file = BASEPATH.'../application/sql/cier.sql';
$host = $db[$active_group]['hostname'];
$user = $db[$active_group]['username'];
$pwd = $db[$active_group]['password'];
$db = $db[$active_group]['database'];
/*命令行导入*/
exec("mysql -h{$host} -u{$user} -p{$pwd} $db < {$file} 2>&1", $output, $ret);
if ($ret != 0)
{
die(implode('<br/>', $output));
} |
|