Hello there folks! Ok, so here’s the story. I had to batch create Joomla users (about 4000 of them) from an excel file that my client provided. So I created all the users successfully (using phpMyAdmin), but there was one problem.
Somehow, all the users that were created from phpMyAdmin aren’t able to login. And I found out it was because the passwords in the database wasn’t encrypted in MD5 format, the default encryption used by Joomla if when you create users via the Joomla backend.
So I guess I had to do it manually. That’s when I came up with this script below that will automatically run through all rows in the database table looking for passwords that aren’t encrypted in MD5 and encrypt it.
MD5 Enryption SQL Query
Here’s how to do it:
- Login to your website’s cPanel and click phpMyAdmin.
- Select your database from the left panel and then select the table you wish to run this code on.
- Click the SQL menu item at the top.
- Enter this query and then click the Run button:
UPDATE ecsconne_users SET `password` = MD5(`password`) WHERE LENGTH(`password`) > 0 AND (LENGTH(`password`) != 65 AND LOCATE(':', `password`) != 33) AND LENGTH(`password`) != 32
Good luck, coders!