Trouble updating from 1.2.17 to 2.25.2 - Database issues

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
bbjorn
Posts: 3
Joined: 22 Sep 2021, 08:28

Trouble updating from 1.2.17 to 2.25.2 - Database issues

Post by bbjorn »

I am trying to update our instance from 1.2.17 to 2.25.2.

I have followed the update guide but when I go to mantisbt/admin/install.php
The page reports the following error:
"Config File Exists but Database does not"

So it seems like the database cannot be found.

I have double checked that all login information is correct.

I have tried accessing the database via php via bash without issues:

Code: Select all

php -r 'var_dump(mysqli_connect("localhost:3306", "myuser", "mypassword", "bugtracker"));'
I really don't know where to look next. Any advice would be appreciated.
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Trouble updating from 1.2.17 to 2.25.2 - Database issues

Post by cas »

and what is the exact definition in config/config_inc.php ?
bbjorn
Posts: 3
Joined: 22 Sep 2021, 08:28

Re: Trouble updating from 1.2.17 to 2.25.2 - Database issues

Post by bbjorn »

My database section in config/config_inc.php looks like this:

Code: Select all

# --- Database Configuration ---
$g_hostname      = 'localhost:3306';
$g_db_username   = 'myuser';
$g_db_password   = 'mypassword';
$g_database_name = 'bugtracker';
$g_db_type       = 'mysqli';
I have also tried using 127.0.0.1 instead of localhost. But no change.
bbjorn
Posts: 3
Joined: 22 Sep 2021, 08:28

Re: Trouble updating from 1.2.17 to 2.25.2 - Database issues

Post by bbjorn »

I finally figured it out. There was not an issues caused by Mantis. The problem was related to the interaction between PHP and the MySQL database. The php.ini file for the Apache server was configured to use the default socket location, however the MySQL server was not configured to use that location for the socket.

So I needed to modify the following setting in php.ini to match the actual location of my actual MySQL socket location:

Code: Select all

; http://php.net/mysqli.default-socket
mysqli.default_socket = /var/lib/mysql/mysql.sock
Post Reply