nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

need to convert text files into mysql database

This is a discussion on need to convert text files into mysql database within the Databases servers forums, part of the Mastering Servers category; Hello, I need to convert text files into mysql database Thanks...


Go Back   nixCraft Linux Forum > Mastering Servers > Databases servers

Linux answers from nixCraft.


Databases servers Discussions of databases of all types - especially MySQL.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 28-08-2007, 10:56 AM
Member
User
 
Join Date: Jan 2007
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
zafar466
Default need to convert text files into mysql database

Hello,
I need to convert text files into mysql database

Thanks
Reply With Quote
  #2 (permalink)  
Old 28-09-2007, 01:17 PM
kasimani's Avatar
Senior Member
User
 
Join Date: Jul 2006
Location: India, Delhi
OS: CentOS, RedHat, Fedora, Ubuntu
Posts: 151
Thanks: 3
Thanked 1 Time in 1 Post
Rep Power: 4
kasimani is on a distinguished road
Send a message via Yahoo to kasimani
Default

first confirm file has the structure and schema and having saved with sql extension.

now u can do 2 things
1: u can login in mysql and type "source" following by "path" of the file.
2: without logging in it, import it by issuing mysqldump or mysqlimport command.

mysqlimport -f /path/of/the/file -d <database>
Reply With Quote
  #3 (permalink)  
Old 12-07-2008, 12:31 PM
Junior Member
User
 
Join Date: Jul 2008
Location: Washington, US
OS: CentOS, Ubuntu
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
memnoch_proxy is on a distinguished road
Default

that's going to depend on if you need to translate your source files into CSV, tab-delimited, or what. MySQL can import CSV files in a clever way. If your dataset is large, filter it into tab-delimited and use LOAD DATA INFILE.
MySQL :: MySQL 5.0 Reference Manual :: 12.2.5 LOAD DATA INFILE Syntax
MySQL :: MySQL 5.1 Reference Manual :: 13.11 The CSV Storage Engine

Good luck!
Reply With Quote
Reply


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

 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
convert perl code into binary executable chandanperl Coding in General 2 12-01-2010 01:03 PM
how to do MYSQL online backup of huge database manish_2479 Databases servers 4 12-07-2008 12:36 PM
text output to mysql chebbab Shell scripting 4 26-11-2007 07:29 PM
ssh backup particular mysql table / database brothers Databases servers 11 25-10-2007 05:06 PM
Appending text files sparky Shell scripting 13 03-04-2006 04:43 PM


All times are GMT +5.5. The time now is 05:55 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38