Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    2

    Unanswered: 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???

  2. #2
    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

  3. #3
    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

  4. #4
    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 Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •