APPLICATION ERROR #400 Database connection failed. Error received from database was #2002: No such file or directory.

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
josephmmorgan
Posts: 6
Joined: 19 Feb 2021, 02:05

APPLICATION ERROR #400 Database connection failed. Error received from database was #2002: No such file or directory.

Post by josephmmorgan »

I apologize in advance for not knowing exactly which MantisBT version I'm using. If there is a file to look at, I'll be glad to look and report. It's about 2 years old when I installed it new. I'm using MySQL 8.03. Running on an Ubuntu Server with 2020.04, 24 core, 64GB RAM and plenty of HD space. Apache is running OK.

I had MantisBT Running just fine on MySQL when another tool I needed asked for MariaDB. What I didn't know is MariaDB would zap parts of MySql. So I scrapped MariaDB and reinstalled MySQL, and I can log in and the mantisbt database is there and the tables are there and the data is there! So far so good. Same old user accounts and passwords work when I log into MySql.

When I attempt to connect to MantisBT, I'm getting:

APPLICATION ERROR #400
Database connection failed. Error received from database was #2002: No such file or directory.

I checked the configuration file "config_inc.php", and it is still intact.

Please help me fix this.
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: APPLICATION ERROR #400 Database connection failed. Error received from database was #2002: No such file or director

Post by cas »

did you check the password for accessing the database in core/config_inc.php?
josephmmorgan
Posts: 6
Joined: 19 Feb 2021, 02:05

Re: APPLICATION ERROR #400 Database connection failed. Error received from database was #2002: No such file or director

Post by josephmmorgan »

Yes, the config_inc.php was all intact. Everything seemed to be intact, and after restoring the true MySQL, I was very glad to find the database intact (though I do have backups of backups...).

While waiting for my post to be moderated, I spent a while playing around, and thought to run the admin check. Though it didn't really flag anything in particular, it dawned on me that at least Apache and Manits and PHP were getting along.

So I decided to just load the admin index.php page, and it loaded fine and asked me for my creds. I put them in and everything worked. From there, I was able to "back-in" to the rest of the MantisBT site by selecting the header. Yet, every time I attempted to go directly to the login_page.php, I got the above error.

So I finally gave up last night, checked this morning, and everything is back to normal. Even the login_page.php.

I may never know what exactly was temporarily broken, but I have to give big Kudos to the MantisBT developers and contributors for making a danged good tool. Evidently, it is somehow self-repairing too!

I thank all those who looked into it, but all is fine now.
juanherko
Posts: 1
Joined: 18 Jan 2022, 17:38

Re: APPLICATION ERROR #400 Database connection failed. Error received from database was #2002: No such file or director

Post by juanherko »

Hello everybody!
i'm getting the same error and can't find a stable solution. If i purge history and cookies it work for some time and get down after a while.

I am running a local installation version 2.25.
File config_inc.php is with correct database credentials.

Any advice?
Post Reply