Hello Paul

you wrote:
>> I would try replacing
>> $database_type = "mysql";
>> by
>> $database_type = "mysqli";
>> maybe?
>>
>> *If* this work, cacti default driver should be changed too. A quick
>> "grep -R database_type" in cacti source seems to show that there are
>> many instances to change...
>>
>> If you don't have a "database" in your config, it must be using the
>> wrong "mysql" value: Try adding it.
> 
> The config does define that. That would be an extremely simple solution.
> 
> Unfortunately, it looks like mysql and mysqli are not compatible (at
> least not on my jessie system with php5:
> Error on web-page:
> FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure
> you have specified a valid MySQL database name in 'include/config.php'
> 
> [Fri Feb 26 16:48:25.181210 2016] [:error] [pid 7222] [client ::1:36225]
> PHP Warning:  mysqli_real_connect() expects parameter 6 to be long,
> string given in /usr/share/php/adodb/drivers/adodb-mysqli.inc.php on
> line 113
> 
> But this probably means that I just have to fix cacti if this is truly
> properly supported by libphp-adodb. We should just reassign I guess.

Actually, this is a another issue that is is being worked at. [1][2]

Ubuntu totally removed the mysql driver, and only mysqli is left [3].
I'm not sure what Debian will do, but you probably should not count on
the mysql driver, and has been issuing deprecated warnings for a while
now...

Until a proper fix is released, can you patch your installed
adodb-mysqli.inc.php file, probably at
/usr/share/php/adodb/drivers/adodb-mysqli.inc.php, at line 121, replace
        $this->port,
by
        (int)$this->port,
and try again the mysqli driver in cacti, please?


[1] https://github.com/ADOdb/ADOdb/issues/218
[2]
https://anonscm.debian.org/git/collab-maint/libphp-adodb.git/commit/?id=ea9704f032df18eb45ec6d6395af3e7a8d3d13f5
[3]
https://patches.ubuntu.com/libp/libphp-adodb/libphp-adodb_5.20.3-1ubuntu1.patch

Reply via email to