使用php将sql文件加载到数据库中
我想将Linux服务器上的sql文件中的数据加载到数据库中。
我这样尝试过。
$query = "LOAD DATA INFILE '/home/technoho/public_html/gpstracking/system/application/controllers/backup/uploads/28_07_11_14_11_07.sql'
INTO TABLE `backup`
FIELDS TERMINATED BY '\', \''
LINES TERMINATED BY '\n'
STARTING BY 'INSERT'";
此查询适用于本地系统文件,但我想从服务器文件加载数据。 我认为我给出服务器文件的路径是错误的。
I want to load data from sql file which is located on linux server to database.
I tried like this.
$query = "LOAD DATA INFILE '/home/technoho/public_html/gpstracking/system/application/controllers/backup/uploads/28_07_11_14_11_07.sql'
INTO TABLE `backup`
FIELDS TERMINATED BY '\', \''
LINES TERMINATED BY '\n'
STARTING BY 'INSERT'";
This query works with local system file, but I want to load data from server file.
I think I am wrong in giving path for server file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MySqlDumper 是完成此类工作的最佳工具
这是一个链接
MySqlDumper is the best tool to use for such a job
here is a link