将数据从文件放到mysql ... [英] putting data from file to mysql...

查看:67
本文介绍了将数据从文件放到mysql ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Helo,


我发现在论坛somebodys帖子:

我正在尝试解析输入文件,然后从该文件中获取数据将其输入MySQL数据库。我正在用标签''\ t''分隔字段,并用换行符''\ n''结束记录。我正在使用LOAD DATA函数(参见下面的代码片段)。

展开 | 选择 | Wrap | 行号

解决方案

aaaaaaaa更多:


我把脚本放在/ usr / lib / cgi-bin /中作为我的所有perl和cgi脚本...所以在哪里放一个文件temp1.txt ???我把它放在与脚本相同的目录中...


我的错误形成命令行:

展开 | 选择 | Wrap | 行号



aaaaaaaa还有更多:


我把脚本放在/ usr / lib / cgi-bin /中作为我的所有perl和cgi脚本...所以在哪里放一个文件temp1.txt ???我把它放了在与脚本相同的目录中...


我的错误形成命令行:

展开 | 选择 | Wrap | 行号


Helo Jeff,


你是完全正确的!我已经纠正了错误,它的工作方式几乎就像我想要的那样..


这里是脚本:

展开 | 选择 | Wrap | 行号< /跨度>

Helo,

I found at forum somebodys post:
I''m trying to parse an input file and then take data from that file and enter it into a MySQL database. I''m separating the fields with tabs ''\t'' and ending the records with a newline ''\n''. I''m using the LOAD DATA function (see the code snippet below).

Expand|Select|Wrap|Line Numbers

解决方案

aaaaaaaa what more:

I put the script in /usr/lib/cgi-bin/ as all my perl and cgi scripts...so where to put a file temp1.txt ???I have put it in the same directory as script...

my errors form command line:

Expand|Select|Wrap|Line Numbers


aaaaaaaa what more:

I put the script in /usr/lib/cgi-bin/ as all my perl and cgi scripts...so where to put a file temp1.txt ???I have put it in the same directory as script...

my errors form command line:

Expand|Select|Wrap|Line Numbers


Helo Jeff,

You are completly right! I have corrected the errors and it works like almost like I wanted to..

here is the script:

Expand|Select|Wrap|Line Numbers


这篇关于将数据从文件放到mysql ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆