网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 服务器与数据库 > MySQL
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Reply
 
Thread Tools Display Modes
  #1   IP: 222.76.215.18
Old 2008-01-24, 09:15 AM
sunshine sunshine is offline
高级会员
 
Join Date: 2006-01-05
Posts: 368
sunshine 正向着好的方向发展
Default 如何将一个文本文件导入到mysql里成为一个单独的表

一个文件data.txt,两个库book1,book2
我想把data.txt导入book1中成为一个独立的表.

将文本数据转到数据库中

1、文本数据应符合的格式:字段数据之间用 tab 键隔开,null 值用 \n 来代替.

例:

3 rose 深圳二中 1976-10-10

4 mike 深圳一中 1975-12-23

2、数据传入命令

load data local infile "文件名" into table 表名;

  注意:你最好将文件复制到 \mysql\bin 目录下,并且要先用 use 命令打表所在的库。
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 03:35 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.