Gallery admin password

For some reason I can not login to my gallery. I guess I may have the wrong password. I was just doing this yesterday. Can anyone tell me how I can change the admin password? No, I didn’t setup the recover function. If I did specify an email addres it isn’t working. Some readon today I can’t reach

Two things to try.

First FTP to your gallery files and look in config.php for the ‘authenticate me’ password. It is a few lines down and looks like:-

$gallery->setConfig(‘setup.password’, ‘A PASSWORD’);

Try that password. You may have used it as the admin password.

Secondly, and this is slightly harder depending on your skills :slight_smile:

Use phpmyadmin from the ControlPanel to open the database for your gallery. If you do not have the details written down in your log book then the details will be in the config.php file above.

Select your database and choose the table User. You may have it prefixed as per all the other tables like ‘g2_User’

Now click the Browse button and you will see your users and their hashed passwords.

The principle is to remove the hashed password and replace it with another one. You then log back in using your new known password and then CHANGE the password once you are logged in.

To change the hashed password edit the admin user record in phpmyadmin and copy the current hashed password to notepad or somewhere safe (so you can put it back if it does not work…which it will!).

To create the new hash you can if you know how write a simple php page called say md5.php in your web document root, containing


<?php $str = 'secretword'; echo md5($str); ?> [/code]Where you can replace 'secretword' with another word. When you view md5.php in your browser you will get a new hash string (0cf0607937013cb58d79a7d3c59d4e11) which you can copy and paste back into the admin record in phpmyadmin.

(Alternativly you can go to and use the demonstration section to create a new hash - make sure you click the MD5 button).

Save the record in phpmyadmin and log into your gallery with the username and new password (The password not the hash!)

Once logged in make sure you CHANGE THE PASSWORD :slight_smile:

I just thought of a third option beloved of Support Desks everywhere when they get stuck. “Reformat the Hard Drive.”

P.S. Do not use the third option!


Opinions are my own views, not DreamHosts’.
I am NOT a DreamHost employee OK!! :@

You act on my advice at your own risk!

I checked my config.php and the password there is
exactly the one that I am trying to use with a
username of admin. When I do that thje login screen
shows a picture and tell me I need to type the number
in the picture. I do that making sure the password
alos typed in and it just keeps coming back.

I can’t find phpmyadmin in control panel.


Okay you will probably have to use the 2nd method via phpmyadmin which you can find under the Manage MySql section here at

Make a note of the password from config.php as it is the ‘authenticate me’ password that you will need when you upgrade Gallery2 at anytime.

Incidentally the username will be a Gallery Administrator when you browse the database.


Opinions are my own views, not DreamHosts’.
I am NOT a DreamHost employee OK!! :@

You act on my advice at your own risk!

That helped thanks. I had the correct password but wrong username. Thanks for telling me about phpmyadmin.

Unless I misunderstood the issue, it seems to me the easiest way to create the new hash would be just to edit the user record (using PhpMyAdmin), type the “unhashed” password in the password field, and then use the “functions” pull-down select box offerred by PhpMyAdmin to select “MD5” prior to saving the record. The result is the “unhashed” password you entered is stored in the database as it’s MD5 hash.