#1
  1. No Profile Picture
    vbedceo
    Guest
    Devshed Newbie (0 - 499 posts)
    I have been keeping my userID and passwords in .htaccess, .htpasswd files (apache authentication). I have just around 2,000 users registered and they need to log in to access my registered pages.

    Now I have just last week installed mySQL database on my server. If I want to copy all existing users + passwords into a table in my mySQL database, how can I go about achieving this task?

    Say my table's name is "userinfo" and I have just 2 fields - userID, password with userID being my PK.

    Thanks much!
  2. #2
  3. No Profile Picture
    moderator
    Guest
    Devshed Newbie (0 - 499 posts)
    Try this syntax:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    LOAD DATA INFILE "./.htpasswd" INTO TABLE userinfo FIELDS TERMINATED BY ':';
    [/quote]

    [This message has been edited by moderator (edited 09-28-99).]
  4. #3
  5. No Profile Picture
    vbedceo
    Guest
    Devshed Newbie (0 - 499 posts)
    So if my protected directory is "test" then it'd be : Am I right? (do I need to copy .htpasswd file from my protected page into the current directory in which my sql is ?)

    LOAD DATA INFILE "/home/www/test/.htpasswd" INTO TABLE userinfo FIELDS userID, passwd TERMINATED BY ':';

    Does the file have to be set in a specific format or the .htpasswd format (with | delimiter is fine by itself)?

    Thanks.


Similar Threads

  1. mysql and MS foxpro
    By wijbenga in forum MySQL Help
    Replies: 16
    Last Post: February 5th, 2004, 12:46 PM
  2. mysql connection
    By cindyqz in forum Java Help
    Replies: 0
    Last Post: August 25th, 2003, 08:33 PM
  3. mysql database help!
    By TweetyPie in forum MySQL Help
    Replies: 2
    Last Post: August 1st, 2003, 07:20 AM
  4. ODBC mySQL Connection Problem
    By kjedwards in forum MySQL Help
    Replies: 1
    Last Post: October 7th, 2001, 04:50 PM

IMN logo majestic logo threadwatch logo seochat tools logo