Encrypt passwords before importing db table to MySQL - any short cuts?

Status
Not open for further replies.

Dotwebs

New Member
Hi,

I hope someone can help me with this before I spend about a week trying to do it the long way.

I have to import a database of my client's users (about 6000) from Access to MySQL to populate the database on their new site. This is fine except that the passwords on the new database have to be encryped (md5). I had planned to import them in the normal way and then write a php script to update the passwords with Md5 encryption in batches.

Does anyone know of an easier/quicker way to do this? Maybe some magic trick in Excel??

Any help appreciated :)
 

php.allstar

New Member
Hi just import everything to MySQL as usual, once thats done run a SQL query similar to:

Code:
update table_name set password = replace(password, password, MD5(password));

Where password is the name of your password field.

You'll want your password field set to VARCHAR(32)

With 6,000 rows this could take a while depending on each row length!
 
Status
Not open for further replies.
Top