Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.11.1 available

The official documentation can be found on http://wiki.ocsinventory-ng.org. Read it before asking your question.

ERROR: MySql connection problem 1045

Hi i have a problem with my database connection when im trying to get acces to ocsreports/index.php

ERROR: MySql connection problem 1045

cAccess denied for user 'ocsuser'@'localhost' (using password: YES)
 

here is my z-ocs-inventory-server.conf


  PerlSetEnv OCS_MODPERL_VERSION 2

  # Master Database settings
  # Replace localhost by hostname or ip of MySQL server for WRITE
  PerlSetEnv OCS_DB_HOST localhost
  # Replace 3306 by port where running MySQL server, generally 3306
  PerlSetEnv OCS_DB_PORT 3306
  # Name of database
  PerlSetEnv OCS_DB_NAME ocs
  PerlSetEnv OCS_DB_LOCAL ocs
  # User allowed to connect to database
  PerlSetEnv OCS_DB_USER ocsuser
  # Password for user
  PerlSetVar OCS_DB_PWD P@SS
 

dbconfig.inc.php


<?php
define("DB_NAME", "ocs");
define("SERVER_READ","localhost");
define("SERVER_WRITE","localhost");
define("SERVER_PORT","3306");
define("COMPTE_BASE","ocsuser");
define("PSWD_BASE","P@$$0rd");
define("ENABLE_SSL","0");
define("SSL_MODE","");
define("SSL_KEY","");
define("SSL_CERT","");
define("CA_CERT","");
 

grants in mariadb


+----------------------------------------------------------------------------------------------------------------+
| Grants for ocsuser@localhost                                                                                   |
+----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `ocsuser`@`localhost` IDENTIFIED BY PASSWORD 'pass_hash' |
| GRANT ALL PRIVILEGES ON `ocs`.* TO `ocsuser`@`localhost` WITH GRANT OPTION                                     |
+----------------------------------------------------------------------------------------------------------------+
 

in OCS Inventory NG server for Unix by (240 points)

1 Answer

0 votes

hy, perhaps this helps

https://github.com/OCSInventory-NG/OCSInventory-ocsreports/issues/430

check

/usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php

and check

/etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php


Sokatra

by (22.6k points)
 
Powered by Question2Answer
...