Unable to connect to database

Hi,
I am fairly new to using conrete5 and i’m looking for help regarding my website.
The error i’m getting on the website is “A database error occurred while processing this request”.
Inside the websites folder under config and site.php i have this:
define(‘DB_SERVER’, ‘192.168.161.248:3306’);
define(‘DB_USERNAME’, ‘username’);
define(‘DB_PASSWORD’, ‘password’);
define(‘DB_DATABASE’, ‘db’);

I have tried changing the db_server to be localhost and making sure the username and password was correct. When trying to connect to the db from mysql workbench and using the same credentials from site.php there was no problem.

It’s important to mention that the website has been running for a while without any problems and no one has changed anything to the config, so the error has happened out of the nowhere.

Feel free too ask questions if i havent provided enough information about the issue.

Thanks in advance!

I would say the we host has move the dB server or done some updates.

Have you contacted them?

I host them myself and they haven’t been moved around as far as i’m aware.
Thanks for reaching out!

Is it completely unmanaged hosting?

No, it is managed hosting

Can you access your database through phpMyAdmin or other and check in the “Logs” table for more detail about that error?

You might also want to try the PHP error log on your server.

Also make sure that in application\config\generated_overrides\concrete.php you have


    'debug' => [
        'display_errors' => true,
        'detail' => 'debug',
        'error_reporting' => null,
    ],

So you have a full error stack. Add it if it’s not there.

Is that the real location of your dB? The 192.168.xxx.xxx subnet is reserved for private local networks. An internet host would only look for that IP address on its local network. It couldn’t possibly connect via the internet back to your local network without something like a VPN tunnel.

Do you also have an instance of your dB running on your internet hosting? If so, more than likely “localhost” would be correct.

look like some thing wrong in hosting