Cannot login to Mantis

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
spaceman_spiff
Posts: 5
Joined: 10 Jan 2025, 16:24

Cannot login to Mantis

Post by spaceman_spiff »

Hey all,

I cannot login to MantisBT anymore. Every time I try to login as "myuser", MantisBT replies with an error "Your account may be disabled or blocked or the username/password you entered is incorrect."

The same "myuser" can correctly login to the (remote) MySQL database from the Mantis server.

Server is RHEL 9. MantisBT version is 2.25.7.

I still have shell access to the server. How can I troubleshoot/solve the issue?

Thanks in advance.
cas
Posts: 1768
Joined: 11 Mar 2006, 16:08
Contact:

Re: Cannot login to Mantis

Post by cas »

Normally you do not login to Mantis with a user that can login to the database, those are 2 different users. Can you not request a new password through the GUI?
spaceman_spiff
Posts: 5
Joined: 10 Jan 2025, 16:24

Re: Cannot login to Mantis

Post by spaceman_spiff »

I clicked on the link for a password reset but I've got no email yet, must be an issue with the mail service.

Is there a way to add an user / reset a password by hand via the config? As said, I have full root shell access to the server and the database.
cas
Posts: 1768
Joined: 11 Mar 2006, 16:08
Contact:

Re: Cannot login to Mantis

Post by cas »

If you have phpmyadmin, you can set the password directly in the DB.
spaceman_spiff
Posts: 5
Joined: 10 Jan 2025, 16:24

Re: Cannot login to Mantis

Post by spaceman_spiff »

I cannot use PhpMyAdmin. What are the commands to do so directly from the MySQL prompt?

Thanks.
cas
Posts: 1768
Joined: 11 Mar 2006, 16:08
Contact:

Re: Cannot login to Mantis

Post by cas »

@ the commandprompt you give the command 'mysql' followed by Enter.
@ the mysql prompt:
- use your_mantis_database ;
- select * from your_mantis_user_table ;
- insert into your_mantis_user_table (username, realname, email, password,
date_created, last_visit, enabled, protected, access_level,
login_count, lost_password_request_count, failed_login_count,
cookie_string)
values ( 'administrator1', '', 'root@localhost', '63a9f0ea7bb98050796b649e85481845', UNIX_TIMESTAMP(CURDATE()), UNIX_TIMESTAMP(CURDATE()), '1', '0', 90,3, 0, 0, '". md5( mt_rand( 0, mt_getrandmax() ) ) "');
- Exit

Now you have a user 'administrator1' with password 'root' including admin rights.
spaceman_spiff
Posts: 5
Joined: 10 Jan 2025, 16:24

Re: Cannot login to Mantis

Post by spaceman_spiff »

Thanks a lot, that worked perfectly!
Post Reply