You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2014-05-06 22:37:23

gadelavega
Member
Registered: 2014-05-06
Posts: 2

MySQL Error (checked username and password)

Hi all,
I installed GLPI a few weeks ago. It was working correctly, but "suddenly" it stopped working, giving this error:

"A link to the Mysql server could not be established. Please check your configuration."

It is not running on a production server, but as far as I know, there has not been a MySQL version change.

Environment as follows:
Ubuntu 12.04.4LTS
MySQL 5.5
NGINX
PHP 5.3.10

Since the error indicates a DB access error, and it is also the only thing I found by googling, y set the username and password manually in config/config_db.php

It looks like this:

<?php
 class DB extends DBmysql {
   var $dbhost = 'localhost';
   var $dbuser = 'glpi';
   var $dbpassword = 'you_dont_need_to_know_this';
   var $dbdefalut = 'glpi';
 }
?>

I tested the connection to the DB, and it works OK.

mysql -hlocalhost -uglpi -p glpi

And also I used some test php code that just connects to the DB and works OK.

Tried enabling debug mode following the indications here,  the MySQL way:
http://www.glpi-project.org/wiki/doku.p … nfig:debug

But file /usr/share/glpi/files/_log/php-errors.log has only two lines with "Test" in it, and has not been modified since installation.

Finally I enabled the MySQL query log and each time I reload the web page I get:

140506 20:15:19      236 Connect    glpi@localhost on 
          236 Query    SET NAMES 'utf8'
          236 Quit    

So I see no error but the web page saying there is one.

I'm quiet sure there must be some silly thing I overlooked... so any help will be greatly appreciated.

Last edited by gadelavega (2014-05-06 22:38:12)

Offline

#2 2014-05-08 05:35:32

chris.anderson3
Member
Registered: 2013-11-06
Posts: 36

Re: MySQL Error (checked username and password)

Hello,

There are quite a few things that you can try... I'll make no assumptions and just throw ideas out there.

1.) If you can go into PHPmyadmin for the MySQL server, make sure that the database name is correct (mine is 'glpidb' by default.. not just 'glpi'... .so if you used the 'default' name during installation, this may be wrong).

2.) Make sure the MySQL is running as a 'service' (I use XAMPP for the back-end install, makes sure everything runs correctly).

3.) Check you PHP log file to see if any errors occur (if there is an equivalent for MySQL, I don't know what it is... but you could google that).

4.) Since you haven't been working long, I'd seriously consider just taking it down and starting over (Maybe export your database from MySQL using an 'export' and then you can re-initialize everything and 'import' it back in.... I have done this many times and have lost nothing thus far. 

This will probably be faster then debugging whats going on - a random "oh the database isn't connection" could go on for a while - but a re-install takes about an hour using XAMPP and a fresh download from the GLPI website.

-Chris


GLPI 90.5     XAMPP- 1.8.2  Apache/2.4.10 (Win32) OpenSSL/1.0.1h PHP/5.4.31

Offline

#3 2014-05-09 22:59:28

gadelavega
Member
Registered: 2014-05-06
Posts: 2

Re: MySQL Error (checked username and password)

Thanks Chris,
I had already tried the first 3 options: MySQL is running and accessible using the DB name, user and passwords configured in the config_db.php file.

I tried reinstalling GPLI with a clean DB and I got another permissions error, this time, I guess, due to some file permissions, but again could not find an answer to that. Still, reinstalling is an option I really don't like. It will not be a reasonable option if this gets into production status.

Offline

Board footer

Powered by FluxBB