MySQL Export of MD5 password fields to new MySQL server

Discussion in 'Programming' started by phaxmohdem, May 30, 2008.

  1. phaxmohdem

    phaxmohdem Golden Member

    Joined:
    Aug 18, 2004
    Messages:
    1,839
    Likes Received:
    0
    I am trying to move a website from my webhosts server to a server at my home. I have exported the online database using the export functions in phpMyAdmin. I have similarly imported that dump file into my new server at home using the Import features of phpMyAdmin, and everything went smoothly, except that when I go to try and log onto the site on my new server, it does not recognize the passwords anymore.

    Is there a way to transfer the MD5 key so the users passwords are preserved? or do I just have to reset all the passwords manually and tell the users what their new passwords are?
     
  2. tfinch2

    tfinch2 Lifer

    Joined:
    Feb 3, 2004
    Messages:
    22,120
    Likes Received:
    0
    Is there any version differences between the two MySQL servers?
     
  3. Crusty

    Crusty Lifer

    Joined:
    Sep 30, 2001
    Messages:
    12,688
    Likes Received:
    0
    First step would be to verify that the MD5 hashes in your new database match the ones from the old database. If they do not, then there was an error with your export/import, perhaps you did an MD5 of an MD5 or something. If the hashes match perfectly, then it sounds like your php code that handles logins is causing the problem.

    We really need a lot more information. Are you salting the passwords at all? How does your login process work? Like tfinch2 said, you should try and keep the versions of your server software the same to try and rule those out.
     
  4. phaxmohdem

    phaxmohdem Golden Member

    Joined:
    Aug 18, 2004
    Messages:
    1,839
    Likes Received:
    0
    I just manually reset the passwords as there are not many users at this point.. but in the future if I go back to an official web host I may run into this issue again. I don't know the MySQL versions off the top of my head, but I guarantee you they are a different build between the two servers.

    I'm running WAMP server at home, the passwords I just use a simple password($user_pass) in the sql statement. I don't know if it is set up to salt the password or not. I did notice that between the two servers that the hashes on the old webserver were quite short compared to the ones my home server uses for the same phrase.
     
  5. tfinch2

    tfinch2 Lifer

    Joined:
    Feb 3, 2004
    Messages:
    22,120
    Likes Received:
    0
    That could be your problem. If I recall correctly, different versions of MySQL have different implementations of the password encryption function.
     
Loading...