
Question:
Hi I just want to clear the question in my mind. I got an error
Unable to connect to your database server using the provided settings.
Filename: core/Loader.php
Line Number: 346
after reading some of issue about that error I try to set $db['default']['db_debug'] = TRUE;
to $db['default']['db_debug'] = FALSE;
and it works!
as I read this in manual of CI Database Configuration
db_debug - TRUE/FALSE (boolean) - Whether database errors should be displayed.
I want to know that does really fix the problem or hiding not the error, but if it only hiding it how come it works? I am worried that it may cause future problem.
same question exist <a href="https://stackoverflow.com/questions/12327775/database-connection-settings-with-db-debug-set-as-false%5Benter%20link%20description%20here%5D%5B1%5D" rel="nofollow">here</a>.
any information and ideas is big help and well appreciated.Many Thanks!
Answer1:Try to $db['default']['pconnect'] = TRUE;
set to false rather than $db['default']['db_debug'] = TRUE;
I found why. In my situation, database error because my mysql config in php.ini is not right.
CI works well after I set mysql config in php.ini, like this:
[Mysql]
mysql.default_socket = /tmp/mysql.sock
If you didn't configure php.ini, the default socket is /var/mysql/mysql.sock, please check it.
I also set $db['default']['db_debug] to FALSE before, it looks ok, but no. It's just hide the error of mysql config, when I test to read from tables of mysql, I got nothing and didn't know why nothing. So I debug it, i found because my mysql connection was not established. :(
Answer3:Its worked for me
$db['default']['pconnect'] = FALSE;