If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Pushing 80Megs to a MySQL DB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-30-04, 15:57
neo3 neo3 is offline
Registered User
 
Join Date: Jan 2004
Posts: 2
Pushing 80Megs to a MySQL DB

I have a list of members that my client has been maintaing via notepad for 2 years now. They want to upload them to a MySQL database, however, the txt file adds up to About 20Megs and their are 4 of them.

How can I push this to MySQL? They are formmated like this:

id username password email
id username password email
id username password email
id username password email
id username password email
id username password email

How can I push them to the database?

If I try through PHPMyAdmin it won't work cuz PHPMyAdmin only will work with like 2 Meg files.

Anyone have any ideas on how I can do this???
Reply With Quote
  #2 (permalink)  
Old 01-30-04, 17:21
aus aus is offline
Registered User
 
Join Date: Oct 2003
Location: Denver, Colorado
Posts: 137
Re: Pushing 80Megs to a MySQL DB

Create a members table that looks like the shape of your data (id, name, password, email). Then use the client tool mysql to run the command LOAD DATA INFILE. Check it out in the documentation, http://www.mysql.com/doc/en/LOAD_DATA.html
Reply With Quote
  #3 (permalink)  
Old 01-30-04, 19:32
neo3 neo3 is offline
Registered User
 
Join Date: Jan 2004
Posts: 2
The problem is, its not enclosed in quotes. I tried to run it but it just won't work. Can someone provide step by step instructions on what to do once in the command shell. I can connect to my DB but I get access denied for some reason, but I use the same usernama and pass to access the same db through PHP. Someone please help.

Also I have another file which is just like this:

email
email
email
email

I am trying to put it into a table with only one field (email) I can't figure out how to do it.

Any help would be greatly appreciated. Thank You Very Much
Reply With Quote
  #4 (permalink)  
Old 01-31-04, 00:26
aus aus is offline
Registered User
 
Join Date: Oct 2003
Location: Denver, Colorado
Posts: 137
I loaded the attached file (no quotes around the fields) into a table using this syntax:

Code:
LOAD DATA INFILE "C:\\web1.txt"  INTO TABLE web
The link explains everything that you need to do.

About the connection problem, is everything done on the localhost?
Attached Files
File Type: txt web1.txt (1.1 KB, 40 views)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On