How to reset admin password using MariaDB 10?

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
Registered User
Posts: 45
Joined: Wed Mar 19, 2014 1:16 pm

How to reset admin password using MariaDB 10?

Post by php-bb3-user »

I accidently deleted the password file for the admin account in phpBB3 forum and needed to recreate that password.
At the time I didn't know how to do that other than using the 'lost password' link.
So I searched and found a way to recreate the password using MD5 hash generator.
Before doing that I'd backed the database up.
Then I created the password I wanted to use for the admin account and converted that into a hash using 'MD5 hash generator'.
Using phpmyAdmin I searched MariaDB 10 for users and found phpbbusers.
Then I looked for the user with ID 2 (which is the admin account) I lost the password for.
I then pasted the hashed user password into the 'user password' field on MariaDB10, but that didn't work out at first.
It didn't work out because I didn't empty cache of phpBB3, but at the time I didn't know how to get that done when I cann't get logged in to the phpBB3 forum first.
Later I found that cache of phpBB3 can be cleared using FTP-client and in cache folder of the root in phpBB3 to remove the 'production' folder.
In 'cache' I (renamed) the 'production' folder, but when I tried to logon again into phpBB3 forum using the front-end login screen, I received an '404, can't find page' error sent by Nginx.

When I checked settings of Web Station on Synology NAS, I found in 'status' that the status of 'personal user webpage' was disabled, although it has been enabled in 'general settings' of Web Station.
For 'personal webpage' to enable, Apache 2.2 and PHP5.6 had to be installed.
PHP5.6 is no longer supported, so I disbled it and upgraded to PHP 7.2 and 7.4.
For 'back-end http server' in Web Station I used default server, which is Nginx in 'general settings' as well as 'virtual host'.

Did I do something wrong or missed something here?
Who can help?
Assumption causes many times lots of trouble.
User avatar
Support Team Member
Support Team Member
Posts: 51889
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve

Re: How to reset admin password using MariaDB 10?

Post by stevemaury »

In phpMyAdmin, run the following, which will create an admin user named Admin1 with a password of admin. From that point you should be able to get into the ACP.

Code: Select all

INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_jabber, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin1', 'admin1', 0, '21232f297a57a5a743894a0e4a801fc3', '', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '');
Change your table prefix if it is not phpbb_

See Executing SQL Queries in phpMyAdmin if you are unfamiliar with running database queries.

As soon as you have done this, use the temporary admin account to change the details on the original admin account, then delete the temporary account.
This is because:
  1. anyone could use that account to log in to your board if you didn't change the password.
  2. this temporary user has not been fully set up (e.g. it is not a member of the "Registered users" group, so it won't have normal access to your forums).
To remove the account you will first need to remove ???founder??? status from it: ACP > USERS AND GROUPS tab > Manage Users > Admin1 > Overview > Founder = No
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
User avatar
Registered User
Posts: 5840
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン

Re: How to reset admin password using MariaDB 10?

Post by AmigoJack »

php-bb3-user wrote:
Sat Feb 20, 2021 12:04 pm
the password file for the admin account
Such a thing does not exist. Are you talking of /config.php which holds the database access credentials, unbound to phpBB administrators?
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
Post Reply

Return to “[3.3.x] Support Forum”