Unable to update MySQL for 2.23.0 via webpage

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Unable to update MySQL for 2.23.0 via webpage

Post by mushu »

Windows Server 2019
MantisBT 2.23.0

Trying to update our Production version of Mantis from 2.22.1 but the final step is to update the database in the /admin/install.php screen since I read there were database changes from previous version. It is unable to connect through the web interface to do the update, keep getting:

BAD
Does administrative user have access to the database? ( Access denied for user 'root'@'fully.qualified.server.namel' (using password: YES) )

It worked fine on our DEV server. So I entered the regular MySQL username/password and that all worked except for the alter table command that gave an error (obviously because the normal user account doesn't have the ability to do that.)

I remoted into the server and ran the MySQL Workbench and logged in just fine locally with the password I was using. The weird thing is that the local version already has the correct username and just asks for the password, yet the username used on the webpage adds an "@" plus fully-qualified domain name after the username. Could that be the problem?

If not, where do I go to look at the MySQL logs to see what it thinks the problem is? We're down until I get this resolved.
TIA!
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: Unable to update MySQL for 2.23.0 via webpage

Post by mushu »

So logged in remotely to the server and running the MySQL Workbench logged in as root, I ran the following two script commands which I think is what the update is trying to do:

ALTER TABLE mantis_bug_file_table ADD bugnote_id INTEGER UNSIGNED DEFAULT 0;

This one above worked fine with no errors.

INSERT INTO mantis_config_table ( value, type, access_reqd, config_id, project_id, user_id ) VALUES ('210', 1, 90, 'database_version', 0, 0 );

This one above however had error:

0 2 12:28:27 INSERT INTO mantis_config_table ( value, type, access_reqd, config_id, project_id, user_id ) VALUES ('210', 1, 90, 'database_version', 0, 0 ) Error Code: 1062. Duplicate entry 'database_version-0-0' for key 'PRIMARY' 0.000 sec

Does that mean I'm fine and can start using the new version since the alter table command worked? Or do I need to trash everything and go back to last night's database backup and start everything all over again?
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: Unable to update MySQL for 2.23.0 via webpage

Post by mushu »

Okay, so looking into this deeper there might be a bug in the installer code (/admin/install.php) because the error is that it tried to do an INSERT into mantis_config_table using a primary key consisting of columns config_id and project_id and user_id with values that are the same as an existing row in that table, thus the duplicate key error.

What we did was do an in-place replacement of the existing value column and manually updated it from '209' to '210' (string values). Then I removed the offline webpage and everything seems to be working fine. Is there a reason we should be concerned that there is not a new row holding the database version value in it?
Post Reply