phpAdmin and the Admin login issue ...

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
kaspencer
Registered User
Posts: 23
Joined: Sat Jan 22, 2005 1:54 pm

phpAdmin and the Admin login issue ...

Post by kaspencer »

Good afternoon all.

I am having that common problem of logging in as Admin, and it is now happening with another user too.
I have cleared the cookies, and even changed that user's password directly in MySQL. However, I note that the other passwords appear to be encrypted in the database, whereas the directly changed Admin password is not, so I realise that I shouldn't do it that way anyway.
The board is new and not yet exposed to its target community.
So, I have noted the solution posted which involves creating user Admin1 though I'm not sure how that user is awarded admin privileges when we cannot login). However as I do not have phpAdmin installed (have I missed something there? I don't recall it being mentioned during installation) I cannot carry out those instructions.
Of course I can install phpAdmin if advised. But are there any special instructions as to how it should be linked with the phpBB installation?

All advice will be gratefully aknowledged.

KASpencer
========
User avatar
warmweer
Jr. Extension Validator
Posts: 11487
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: phpAdmin and the Admin login issue ...

Post by warmweer »

kaspencer wrote: Mon Feb 19, 2024 5:43 pm ...
So, I have noted the solution posted which involves creating user Admin1 though I'm not sure how that user is awarded admin privileges when we cannot login). However as I do not have phpAdmin installed (have I missed something there? I don't recall it being mentioned during installation) I cannot carry out those instructions.
Admin1 has founder status, so he can login and give him/herself any permissions needed
kaspencer wrote: Mon Feb 19, 2024 5:43 pm Of course I can install phpAdmin if advised. But are there any special instructions as to how it should be linked with the phpBB installation?
========
phpMyadmin is just a program allowing database management. It (phpMyAdmin) is not needed as such as there are other database managers that have similar functionality e.g. Adminer.

The question is: how did you create the database when you first installed phpBB? (the config.php contains info on the database, dbuser and dbuser_password
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53490
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: phpAdmin and the Admin login issue ...

Post by Brf »

You can't put a plaintext password in your users table. It would have to be hashed.

PhpMyAdmin would be part of your hosting package, and allow easy access to your database tables.

I am not sure what your question is about the Admin1 user mentioned in other topics. You would log in with that user after adding it to your users table.
kaspencer
Registered User
Posts: 23
Joined: Sat Jan 22, 2005 1:54 pm

Re: phpAdmin and the Admin login issue ...

Post by kaspencer »

Brf wrote: Mon Feb 19, 2024 5:54 pm You can't put a plaintext password in your users table. It would have to be hashed.
PhpMyAdmin would be part of your hosting package, and allow easy access to your database tables.
I am not sure what your question is about the Admin1 user mentioned in other topics. You would log in with that user after adding it to your users table.
Thank you Brf: Indeed that was what the SQL query presented by several offered solutions to this issue did: i.e. it added a clear text password.
See below re. phpMyAdmin.
warmweer wrote: Mon Feb 19, 2024 5:51 pm Admin1 has founder status, so he can login and give him/herself any permissions needed.
Thankyou Warmweer: except that, like those others seeking help on this issue, Admin couldn't log in!
See also below re. phpMyAdmin (now installed and useful).
warmweer wrote: Mon Feb 19, 2024 5:51 pm The question is: how did you create the database when you first installed phpBB? (the config.php contains info on the database, dbuser and dbuser_password.
The answer is: my MySQL database server had been created quite sometime ago. Therefore phpBB's database (phpBBDB) was added to the existing server. However, this is not significant because phpBB was functioning and other users could be added: it was simply that Admin could not login.

So, thankyou both.

As an update, and for anyone else who encounters this issue with the Admin user (and many have) here is how I resolved the problem:
1. Open (or install phpMyAdmin) - it shows a great deal of the benhind-the-scenes data in your phpBB installation;
2. Ensure that you BROWSE via "MySQL" server, "phpBB" database (use your specific database name) to the "phpbb_users" table.
You will probably have to select "Show All";
3. Scroll about to find the record of a functioning user account, whose password you know;
4. Locate the column "user_password": the text will be long and meanlingless.
5. Highlight the entire password (a popup will reveal all of it), and tap Ctrl+C to copy it;
6. Locate the record which has "Admin" in the "username" column;
7. In that record, delete the text in the "user_password" column;
8. Tap Ctrl+V to copy the new password into the "user_password" column.

You can now log in to the Admin account on your phpBB board. BUT remember to change that password to Admin in your phpBB board to something private!

KASpencer
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26715
Joined: Fri Aug 29, 2008 9:49 am

Re: phpAdmin and the Admin login issue ...

Post by Mick »

In actual fact the correct instructions are as follows:

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', '[email protected]', '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
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel©
🇬🇧
kaspencer
Registered User
Posts: 23
Joined: Sat Jan 22, 2005 1:54 pm

Re: phpAdmin and the Admin login issue ...

Post by kaspencer »

Thanks, Mick.

The post which you quoted was the one which I saw and used a little while ago when trying to solved the issues and which was a great help in my fault-finding.

Although I created a phpBB Board in 2005 (in Windows and hosted by my main ISP, and worked forst time without issue!), I had forgotten all I learned in that experience when I came to develop the present project. This one is hosted in my office on one of my own servers (actually a Raspberry Pi under Debian 11, Raspbian Bullseye). And it has been a nightmare!

As regards SQL: I worked on (i.e. installed SCO Unix, then Oracle, then commissioned the database application, then trained the users) a very large NHS Oracle database from 1992-96, then I developed two financial applications under my own Windows Server 2k3 R2 and SQL Server, so I should be able to cope! But my aging brain (almost 78) forgets more than it remembers.

I am convinced that it is bad browser behaviour coupled with some less than perfect coding that leads to all these problems with Loggings-In. But I found the current Chrome seems good, Firefox less so. It seems that some data is cached and then not always cleared.

Best wishes,

Kenneth
Last edited by kaspencer on Mon Feb 26, 2024 4:29 pm, edited 1 time in total.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53490
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: phpAdmin and the Admin login issue ...

Post by Brf »

kaspencer wrote: Thu Feb 22, 2024 3:19 pm the SQL query presented by several offered solutions to this issue did: i.e. it added a clear text password.
It does not. The password it adds is 21232f297a57a5a743894a0e4a801fc3 which is the hash for admin
kaspencer
Registered User
Posts: 23
Joined: Sat Jan 22, 2005 1:54 pm

Re: phpAdmin and the Admin login issue ...

Post by kaspencer »

Brf wrote: Mon Feb 26, 2024 1:52 pm It does not. The password it adds is 21232f297a57a5a743894a0e4a801fc3 which is the hash for admin
Brf: Its possible that I used a different version of that bit of SQL, as several suggestions can be found, although I thought that was it. But the SQL I copied (which was very similar indeed) most definitely did write the password in clear text.

Everyone else: thanks for your contributions in this Saga: one way or another the board is now accepting logins, although I have just one more issue to resolve before it can be released (see below).

The next issue is getting a repacement jpg to display as an amended header image. in common with quite a number of other users, all recommendations tried so far fail to display the new image. I think that asking phpBB board creators to edit system files directly is not the wisest option: it should be possible to put some code behind an action button which could upload an image and make appropriate changes to the .css (etc) files, as is generally used in many other applications for file uploading.

Nearly there! I'll keep trying.

KASpencer
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28815
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier

Re: phpAdmin and the Admin login issue ...

Post by Paul »

phpBB doesn't support plain text passwords, so that doesn't sound likely.
User avatar
warmweer
Jr. Extension Validator
Posts: 11487
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: phpAdmin and the Admin login issue ...

Post by warmweer »

kaspencer wrote: Mon Feb 26, 2024 5:10 pm
Brf: Its possible that I used a different version of that bit of SQL, as several suggestions can be found, although I thought that was it. But the SQL I copied (which was very similar indeed) most definitely did write the password in clear text.
Which would imply that if you manually change the value in the password field to admin (or anything else) you should be able to login with that password.
Try it. ;)
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
kaspencer
Registered User
Posts: 23
Joined: Sat Jan 22, 2005 1:54 pm

Re: phpAdmin and the Admin login issue ...

Post by kaspencer »

warmweer wrote: Mon Feb 26, 2024 5:32 pm Which would imply that if you manually change the value in the password field to admin (or anything else) you should be able to login with that password.
Try it. ;)
Thanks, warmweer, but I had already tried some time ago putting a password directly into the database in clear text, and that didn't work (as someone else said, passwords must be hashed.) However, if I copied a hashed value of a users password which I knew, that did work.

But the issue has stopped plagueing me now as the test accounts are workingand I'm nearly ready for the board to go live.

Thanks,

KASpencer
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26715
Joined: Fri Aug 29, 2008 9:49 am

Re: phpAdmin and the Admin login issue ...

Post by Mick »

kaspencer wrote: Mon Feb 26, 2024 5:10 pmit should be possible to put some code behind an action button which could upload an image and make appropriate changes to the .css

There’s an extension that facilitates changing the Site Logo (I think you have to register on the site to be able to download the extension) or there’s a KB Knowledge Base - How to change your board logo. If you feel you’d like to have that added as a feature you can post in the ideas forum.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel©
🇬🇧
User avatar
warmweer
Jr. Extension Validator
Posts: 11487
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: phpAdmin and the Admin login issue ...

Post by warmweer »

Change Logo is a validated extension and works just fine (can even use a remote image).
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26715
Joined: Fri Aug 29, 2008 9:49 am

Re: phpAdmin and the Admin login issue ...

Post by Mick »

warmweer wrote: Tue Feb 27, 2024 11:26 am(can even use a remote image)
You can with the one I mentioned too :)
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel©
🇬🇧

Return to “[3.3.x] Support Forum”