Thread "database host = localhost, doesn't work for setup..."
Tabs
-
Deleted | 21. Sep 2017, 22:41
Edited on: 21. Sep 2017, 22:42 - by Deleteddatabase host = localhost, doesn't work for setup...Hello,
I'm installing ILIAS on my server, and I'm actually in front of a problem: on the ILIAS setup, on the "Create New Client" page, at the "Database Connexion", for "Database Host" I entered "localhost" (which is the host name of my mysql, I've verified it in the files mysql_clientdb.conf and config.inc.php), but it gives as a result : Database can't be reached. Please check the credentials and if database exists.
Is that a problem with the host name, or the database name, or password, or all together?...
I've tried both with myISAM and InnoDB... but without result.
(for info, my InnoDB version is 5.6... not 5.5).
So, I don't know what to do...
Cheers
-
Timon Amstutz | amstutz | 22. Sep 2017, 08:44
Re: database host = localhost, doesn't work for setup...To find out wheter this is an ILIAS related problem, have you tried out to access your db through command line:
mysql --host=localhost --user=myname --password=mypass mydb
-
Deleted | 22. Sep 2017, 10:59
Re: database host = localhost, doesn't work for setup...Just to eliminate some obvious causes:
- Both Webserver and database run on the same host? 'localhost' isn't really a hostname but rather refers to the local machine.
- what operating system/Distribution?
- If you use Unix/Linux: Are you aware of the fact that 'localhost' has a specific meaning for MySQL (stupid,stupid,stupid!): the connection is not using TCP but rather a unix socket. You might want to use a TCP adress instead (127.0.0.1)
-
Deleted | 22. Sep 2017, 21:47
Edited on: 22. Sep 2017, 21:50 - by DeletedRe :database host = localhost, doesn't work for setup...Hi,
thanks a lot for your help. I succeed to resolve my problem (ahem, how ot say... hurrrra! ;))
Answers below.
@Timon Amstutz: yes, I have already tried this commande and it's working on a terminal: with this command (mysql --host=localhost --user=myname --password=mypass mydb) I'm able to connect to MySQL/MariaDB via SSH.
And if I ask: show databases; it returns my databases and ilias databes is inside.
But on ILIAS setup, it doesn't work...
@Ralf Mattes: to answer to your questions:
- yes, both webserver and database run on the same host (if you mean on the same server) ;
- OS is Debian 9.1.0;
- actually I have tried to replace "localhost" by "127.0.0.1" and... it's working!
So, thank you very much Ralf!
I was not expecting that such local ip adress will replace so easily "localhost" (but it's logic in meantime...). Thanks again.