Unable to login to localhost as admin

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
User avatar
meetdilip
Registered User
Posts: 123
Joined: Mon Sep 01, 2014 4:33 am

Unable to login to localhost as admin

Post by meetdilip »

Hi, I created a local copy of my forum. I added files to XAMPP manually, created a new DB and imported the latest backup DB. Everything works fine except that my admin password that works online is not working on localhost. Why is that so?

Using phpBB 3.3.11 and Ubuntu 22.04 + XAMPP. Thanks.
User avatar
warmweer
Jr. Extension Validator
Posts: 11450
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Unable to login to localhost as admin

Post by warmweer »

meetdilip wrote: Sat Jan 13, 2024 1:56 pm Hi, I created a local copy of my forum. I added files to XAMPP manually, created a new DB and imported the latest backup DB. Everything works fine except that my admin password that works online is not working on localhost. Why is that so?

Using phpBB 3.3.11 and Ubuntu 22.04 + XAMPP. Thanks.
If you imported the latest db Backup, then it's pointing to your online board, not the XAMPP copy.

see Transferring Your Board to a New Host or Domain
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
KevC
Support Team Member
Support Team Member
Posts: 72470
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK

Re: Unable to login to localhost as admin

Post by KevC »

'Doesn't work' is not very helpful.
What error do you get?
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
User avatar
meetdilip
Registered User
Posts: 123
Joined: Mon Sep 01, 2014 4:33 am

Re: Unable to login to localhost as admin

Post by meetdilip »

Hi @KevC,
It says wrong username / password. I took a screenshot, since it asks for CAPTCHA too now because I made multiple failed attempts
Screenshot from 2024-01-13 19-56-04.png
@warmweer

I used cPanel Backup wizard and exported the database, used file manager, compressed the folder and downloaded it. Now unzipped and added to htdocs. Made a new DB, imported the downloaded DB to it. Also changed config.php with new database name, username as " root " and no password.

That guide is a bit too much for me. Would be helpful if you can tell me the area which points to the domain instead of localhost.

I tried the password on my online board, it works. Thanks.
You do not have the required permissions to view the files attached to this post.
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72470
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK

Re: Unable to login to localhost as admin

Post by KevC »

What happens if you solve the captcha?
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
User avatar
meetdilip
Registered User
Posts: 123
Joined: Mon Sep 01, 2014 4:33 am

Re: Unable to login to localhost as admin

Post by meetdilip »

Just to be sure, I created a new database and the import was successful

Import has been successfully finished, 681 queries executed. (prefix_dbname.sql.gz)

Then I changed the config.php to the new database name and board works. But when I try to login, it doesn't. Says
You have specified an incorrect password. Please check your password and try again. If you continue to have problems please contact the Board Administrator.
User avatar
meetdilip
Registered User
Posts: 123
Joined: Mon Sep 01, 2014 4:33 am

Re: Unable to login to localhost as admin

Post by meetdilip »

I tried solving CAPTCHA twice, once without username and password, it gave the same error. Second time with both boxes blanks, it said you cannot login without a password.
You have specified an incorrect password. Please check your password and try again. If you continue to have problems please contact the Board Administrator.
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72470
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK

Re: Unable to login to localhost as admin

Post by KevC »

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
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
User avatar
meetdilip
Registered User
Posts: 123
Joined: Mon Sep 01, 2014 4:33 am

Re: Unable to login to localhost as admin

Post by meetdilip »

Thanks, on it.

the database prefix is phpbbXX now.
User avatar
meetdilip
Registered User
Posts: 123
Joined: Mon Sep 01, 2014 4:33 am

Re: Unable to login to localhost as admin

Post by meetdilip »

Hi did 2 things

First,

I changed the phpbb_users in the query to phpbbXX_users matching the current prefix. It worked but got a plain board. All categories and posts gone, ProLight theme reset to Prosilver. I was able to get into ACP, but no users to modify.

Second,

Assuming I made a mistake, I changed the table prefix to phpbb for all tables in a new database ( copy of the first, new + old db imported, the same as the first ), this time, I ran the exact query you gave. Now I get an SQL error, even though I updated both database name and $table_prefix in config.php

The error is
Return to index page
General Error
SQL ERROR [ mysqli ]

Table 'mytest.phpbbXX_config' doesn't exist [1146]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72470
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK

Re: Unable to login to localhost as admin

Post by KevC »

All that query does is make an account, absolutely nothing else. Are you sure the config.php file is looking at the correct database?
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
User avatar
meetdilip
Registered User
Posts: 123
Joined: Mon Sep 01, 2014 4:33 am

Re: Unable to login to localhost as admin

Post by meetdilip »

Hi, this happens only when I am logged in as Admin1, otherwise as guest I can see the full board and posts.

While logged in as Admin1, the stats are intact at the bottom.
Total posts 346 • Total topics 127 • Total members 3 • Our newest member Admin1
User avatar
meetdilip
Registered User
Posts: 123
Joined: Mon Sep 01, 2014 4:33 am

Re: Unable to login to localhost as admin

Post by meetdilip »

KevC wrote: Sat Jan 13, 2024 3:14 pm All that query does is make an account, absolutely nothing else. Are you sure the config.php file is looking at the correct database?
Hi, yes. I have 3 test databases to which I imported the backup DB. Tried different options, this is my config.php now

Code: Select all

<?php
// phpBB 3.3.x auto-generated configuration file
// Do not change anything in this file!
$dbms = 'phpbb\\db\\driver\\mysqli';
$dbhost = 'localhost';
$dbport = '';
$dbname = 'mytest';
$dbuser = 'root';
$dbpasswd = '';
$table_prefix = 'phpbbXX_';
$phpbb_adm_relative_path = 'adm/';
$acm_type = 'phpbb\\cache\\driver\\file';

@define('PHPBB_INSTALLED', true);
@define('PHPBB_ENVIRONMENT', 'production');
// @define('DEBUG_CONTAINER', true);
User avatar
meetdilip
Registered User
Posts: 123
Joined: Mon Sep 01, 2014 4:33 am

Re: Unable to login to localhost as admin

Post by meetdilip »

Just to avoid confusion,

currently, all posts visible as guest

As Admin1, only a fresh board with old stats. Can get into ACP.

No error message anywhere now. Thanks.
User avatar
meetdilip
Registered User
Posts: 123
Joined: Mon Sep 01, 2014 4:33 am

Re: Unable to login to localhost as admin

Post by meetdilip »

Hi, I changed the old Admin password to a new one through Admin1. All good now. No words to thank you all. :)

Return to “[3.3.x] Support Forum”