pluginsGLPI / ocsinventoryng

Plugin ocsinventoryng for GLPI
GNU General Public License v2.0
68 stars 52 forks source link

Connection to the database failed #318

Open MarchuckPL opened 2 years ago

MarchuckPL commented 2 years ago

Hi, I have problem setting up connection to OCS DB in GLPI OCS extention. Both OSC and GLPI are installed on same VM using Apache and MariaDB. User "ocs_user" was used in OSC installation without problems so it have proper privilages to osc database. I can connect to osc DB using osc_user from within linux server and remotly. In host field I have tried "localhost" , 127.0.0.1 , and IP adress with http, https and without it. Also this is fresh installation of GLPI server

image

This is the error massage from GLPI debug mode: PHP Warning (2): mysqli::real_connect(): (HY000/1045): Access denied for user 'ocs_user'@'localhost' (using password: NO) in /var/www/html/glpi/src/DBmysql.php at line 247

Same massage is observed in DB errorlog: Access denied for user 'ocs_user'@'localhost' (using password: NO)

So far i tested reinstallig extension, reinstaling GLPI, creating new DB user with basic password using only letters and making sure is has full provilages to osc database.

image

Second account for connection testing image

image

tsmr commented 2 years ago

Please test with master version ? https://github.com/pluginsGLPI/ocsinventoryng/archive/refs/heads/master.zip

MarchuckPL commented 2 years ago

Same image

image

tsmr commented 2 years ago

You tried to enter your password again ?

MarchuckPL commented 2 years ago

I just wanna point out that OSC Server And GLPI server are located in the same Vm using same Apache and same DB instace. OCS server can connect to ocs database without problems so i assume databes, databas user and privilages are setup right and still in OSCplugin setup i cannot connect to ocs database using same DB user that is working in OCS server. Password was "cleared" multiple times and each time it was copied from keepas, no option for misspeling

tsmr commented 2 years ago

Try to connect it with shell before ?

Try to enter your password again ? after install master version

MarchuckPL commented 2 years ago

ocs database now has two users with full privilages, i can connect with both users to ocs database using mysql -u -p within ubuntu server that databes is installed, also i can can connect to ocs database with bot acc from my windows host using sqlmanagmentstudio. One of those users us used in OCS server that is currently running. All password was created and pasted using keepass. I cleared password after installing master version, saved then entered password once again and saved, multible times with same result.

ajavor commented 2 years ago

Have You tried this solution?

https://github.com/pluginsGLPI/ocsinventoryng/issues/312

MarchuckPL commented 2 years ago

Hi, For me it was already set to encrypt image image

MarchuckPL commented 2 years ago

Is there any file that i can check if password im entering in gui is stored correctly in config files? Also i wanna point out that after adding skip-grand-tables in 50-server.cnf osc extension started to work but this is not a solution, it opens full access to all databeses for all connection, it was done just for test

MarchuckPL commented 2 years ago

Any more ideas? If You need more information i can provide any log, config etc just ask

MarchuckPL commented 2 years ago

Problem is still not solved. I'll appreciate any help

MarchuckPL commented 2 years ago

Changing MariaDB to MySQL or postgresql is worth testing?

0xNath commented 2 years ago

I got exactly the same issue with :

fgendorf commented 2 years ago

Same here,


Frederico Gendorf

On Tue, Apr 12, 2022 at 11:19 AM Nathanaël Renaud @.***> wrote:

I got exactly the same issue with :

  • GLPI version : 10.0.0-rc3
  • OCS Inventory NG version : 2.0.0-rc2
  • MariaDB server bersion : 10.5.15-MariaDB-0+deb11u1 Debian 11
  • PHP version : 7.4.28

— Reply to this email directly, view it on GitHub https://github.com/pluginsGLPI/ocsinventoryng/issues/318#issuecomment-1096791932, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSWPYD3AVCJ3S7BJ7KMU2LVEWA5RANCNFSM5R6Y3T7Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ajavor commented 2 years ago

try new version plugin 2.0.0 (final release). for me it works fine and syncs

obraz

obraz

evillduck commented 1 year ago

Problem is still not solved. I'll appreciate any help

I found a solution that worked for me!

The problem was that my db user password had special characters, I just created another user to access the db with simple password and it worked!