Welcome Guest, Not a member yet? Register   Sign In
Database connection
#1

[eluser]Unknown[/eluser]
I'm currently having a issue with connecting to my database.
Currently i'm using a MySQL database which generates the following error in CodeIgniter:

A Database Error Occurred

Unable to connect to your database server using the provided settings.

Below is a snippet of my database.php file

Code:
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'usernameHere';
$db['default']['password'] = 'passwordHere';
$db['default']['database'] = 'databaseHere';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

Connecting to this database with Codeigniter works perfectly as long as a user account that doesnt require a password is used. As soon as a password is used at the $db['default']['password'] field, the error comes up. Logging in with the same creditentials in other software (MySQL Workbench, JDBC and such) the connection works fine.
(Setting pconnect to false doens't solve the issue)

Is there any way to solve this issue?

EDIT: Just tried it with another database server, same issue. Without the need of a password it works fine, when using a password it generates the error.




Theme © iAndrew 2016 - Forum software by © MyBB