Home > Database > Mysql Tutorial > body text

mysql中导入较大数据简单实现代码

WBOY
Release: 2016-06-07 17:51:47
Original
965 people have browsed it

本文章介绍了mysql自带的方法来快速导入较大的数据库哦,有需要了解的朋友可参考一下。

dbhost 改为您的服务器地址(小提示:一般主机默认数据库服务器地址是:localhost)
dbuser 改为您的数据库用户名
pass 改为您的数据库用户密码
dbname 改为您的数据库名
backup.sql表示通过ftp上传到网站根目录下数据库文件的文件名(该文件是解压缩后的文件)


1.将数据库备份文件(如backup.sql)上传至网站根目录。
2.将以下代码保存为mysql.php文件,上传至网站根目录。

 

 代码如下 复制代码
system("mysql -hdbhost -udbuser -ppassword dbname print "导入成功";
?>
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!