Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error: Uncaught exception 'Exception' with message 'Could not connect to database! SQLSTATE[28000] [1045] Access denied for user 'phpipam'@'localhost' (using password: YES)' in /var/www/html/phpipam/functions/classes/class.PDO.php:159 #75

Open
bhanuprasadanukonti opened this issue Oct 11, 2021 · 1 comment

Comments

@bhanuprasadanukonti
Copy link

We are trying to do Automatic host availability and discovery check by following this document https://phpipam.net/news/automatic-host-availability-check/.

Here is the full error related to php script:

/usr/bin/php /var/www/html/phpipam/functions/scripts/pingCheck.php
PHP Fatal error: Uncaught exception 'Exception' with message 'Could not connect to database! SQLSTATE[28000] [1045] Access denied for user 'phpipam'@'localhost' (using password: YES)' in /var/www/html/phpipam/functions/classes/class.PDO.php:159
Stack trace:
#0 /var/www/html/phpipam/functions/classes/class.PDO.php(1053): DB->connect()
#1 /var/www/html/phpipam/functions/classes/class.PDO.php(298): Database_PDO->connect()
#2 /var/www/html/phpipam/functions/classes/class.Common.php(236): DB->escape('id')
#3 /var/www/html/phpipam/functions/classes/class.Common.php(411): Common_functions->fetch_object('settings', 'id', 1)
#4 /var/www/html/phpipam/functions/classes/class.Log.php(292): Common_functions->get_settings()
#5 /var/www/html/phpipam/functions/classes/class.Subnets.php(120): Logging->__construct(Object(Database_PDO))
#6 /var/www/html/phpipam/functions/scripts/pingCheck.php(38): Subnets->__construct(Object(Database_PDO))
#7 {main}
thrown in /var/www/html/phpipam/functions/classes/class.PDO.php on line 159

Any help is appreciated.

@NinjaAway
Copy link

NinjaAway commented Feb 2, 2022

Hello,
I was on the same problem for almost a day...
The solution for me was simple, I writted incorrectly the environments variables : IPAM_DATABASE_HOST.
Check yours and with that, the name of your value. Is it correct too ?
It could be the same with IPAM_DATABASE_PASS. Do not put any quotes on your password.
(inside the phpipam-cron container variables)

  • IPAM_DATABASE_USER=phpipam
  • IPAM_DATABASE_PASS=phpipampassword

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants