Can't connect to database - while being logged in in Hesk?!

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
jaapvdv
Posts: 6
Joined: Tue Jan 17, 2017 5:52 pm

Can't connect to database - while being logged in in Hesk?!

Post by jaapvdv »

Script URL: https://helpdesk.eisergon.nl
Version of script: 2.6.6
Hosting company: -
URL of phpinfo.php: https://helpdesk.eisergon.nl/info.php
URL of session_test.php: ?
What terms did you try when SEARCHING for a solution: Can't connect to database

Write your message below:

Earlier today I was logged in to the backend of Hesk to reply to a ticket. Upon sending the reply Hesk surprised me with the error 'Can't connect to database'.
Initially I got this error in the Hesk GUI.

Later when reloading Hesk it showed me the error message directly in a text only page.

Other websites accessing the same db-server have no problem. Accessing the db-server (MySQL) using the credentials in the Hesk settings file works without a problem (so that rules out incorrect credentials). Any idea?

Kind regards,

Jaap van der Veen
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Can't connect to database - while being logged in in Hesk?!

Post by Klemen »

Not sure what is going on, but this usually means the DB server is rejecting connections. Perhaps you have too many active connections to the database (not just from Hesk, but site-wide)?

To get more info about what is happening try this:

1. backup existing files
2. download hesk_settings.inc.php
3. open it in a powerful text editor, such as Notepad++
4. change

Code: Select all

$hesk_settings['debug_mode']=0;
to

Code: Select all

$hesk_settings['debug_mode']=1;
5. save, upload and test

The error message should now give more details.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
jaapvdv
Posts: 6
Joined: Tue Jan 17, 2017 5:52 pm

Re: Can't connect to database - while being logged in in Hesk?!

Post by jaapvdv »

Hi Klemen,

Thanks for replying.

I just opened Hesk, and it works!

I'll keep on eye on the DB-server though.

Regards,

Jaap
anika
Posts: 8
Joined: Mon Nov 07, 2016 10:09 am

Re: Can't connect to database - while being logged in in Hesk?!

Post by anika »

Hi there,

I experience the same problem since today without changing anything.

I already changed the hesk_settings.inc.pho and now receive the following error message:
MySQL antwortet:
(2002) php_network_getaddresses: getaddrinfo failed: No address associated with hostname
Do you have an idea what is going wrong?

Thank you.

Anika
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Can't connect to database - while being logged in in Hesk?!

Post by Klemen »

This means PHP cannot resolve your database host name (cannot "convert" it into an IP address), so it's an underlying hosts/resolver problem on the server somewhere.

You can try entering the IP address of your MySQL server instead of hostname in hesk_settings.inc.php (backup first!) in the line starting with

Code: Select all

$hesk_settings['db_host']
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
anika
Posts: 8
Joined: Mon Nov 07, 2016 10:09 am

Re: Can't connect to database - while being logged in in Hesk?!

Post by anika »

Thank you, it is working again :)
Post Reply