Welcome Guest, Not a member yet? Register   Sign In
MySQLi Connection error
#1

[eluser]Atasa[/eluser]
Hello everyone,
I was very happy to see all these changes and progress to ci with version 1.7,
especially to the Validation class.
Please someone can confirm this...
There is an error coming out saying that Unable to connect to database with the provided settings.
For sure in 1.6.3 I was able to connect therefor I enabled the logs to see what's wrong.

Surprisingly the error was:

Severity: Warning --> mysqli_connect() expects parameter 5 to be long, string given /srv/www/ci/admin/system/database/drivers/mysqli/mysqli_driver.php 63

On line 63 exists the function db_connect(), and I am not using it.
I use the function db_pconnect() beacause I have set it to TRUE in my config file.

Any comment will be appreciated

A.
#2

[eluser]Piziwate[/eluser]
Hello Atasa, Hello everybody !

I have exactly the same problem :

Here is my "Test" Db Config

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "";
$db['default']['database'] = "test";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "test_";
$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";

DEBUG - 2008-10-26 17:40:32 --> Database Driver Class Initialized
ERROR - 2008-10-26 17:40:32 --> Severity: Warning --> mysqli_connect() expects parameter 5 to be long, string given E:\Developpement\www\smartnms\system\database\drivers\mysqli\mysqli_driver.php 63
ERROR - 2008-10-26 17:40:32 --> Unable to connect to the database

If I use mysql instead of mysqli, everything is working fine !

Regards

Piziwate
#3

[eluser]Randy Casburn[/eluser]
Hi,

Version 1.7.0 added support for a port configuration, but didn't make the configuration optional.

if you add:

$db['default']['port']= '3306';

things should be just fine. I know that might not make sense given the error, but that will fix you.

Hope that helps.

Randy
#4

[eluser]Piziwate[/eluser]
Thank you ! it worked for me !

Regards

Piziwate
#5

[eluser]Randy Casburn[/eluser]
You're very welcome! And Welcome to CI too!

Randy
#6

[eluser]Piziwate[/eluser]
Thank you ! I searched a lot of time a good server side framework to use with ExtJs ! And CI was the best for me !

Regards !

Steve
#7

[eluser]Randy Casburn[/eluser]
When I get time I'm going to publish how I've laid out ExtJS and CI together. cu.
#8

[eluser]qwertyqwerty[/eluser]
I can confirm that adding $db[‘default’][‘port’]= ‘3306’; does fix the problem!

There are two things that need to be done to fix this bug:
- The class variable $port should have default value of 3306
- $db[‘default’][‘port’]= ‘3306’; should be added to the database.php config file
#9

[eluser]Randy Casburn[/eluser]
I've been told that this has been fixed in SVN. So the CI team is taking care us folks.

These guys are great.

Randy




Theme © iAndrew 2016 - Forum software by © MyBB