# Cacti Installation - MySQL Version Problem libmysqlclient.so.15



## Sirup (Mar 2, 2010)

Hello,

*Facts about my System:*
 -FreeBSD
 -Apache 2.2
 -Cactt 0.8.7 via Ports
 -MySQL 5.5
 -PHP5

*Problemdescription:*
Cannot view localhost/cacti nor  localhost/cacti/phpinfo.php (Both times Blank Page, insertd <p>test</p> -> See White Page with test on it)

*Assumption:*
PHP is not working correctly.

php -m shows:

```
PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613/mysql.so' - Shared object "libmysqlclient.so.15" not found, required by "mysql.so" in Unknown on line 0
```

Directory /usr/local/lib/mysql contains (where the libmysqlclient.so.15 should be)

```
libdbug.a             
libmysqlclient.so      
libmysqlservices.a
libheap.a               
libmysqlclient_r.a     
libmystrings.a
libmyisam.a            
libmysqlclient_r.la     
libmysys.a
libmyisammrg.a       
libmysqlclient_r.so     
libvio.a
libmysqlclient.a        
libmysqlclient_r.so.16  
plugin
```

But there is no libmysqlclient.so.15 only a libmysqlclient.so.16. Before I installed Cacti I upgraded MySql-Server and MySql-Client from Version 5.0 to version 5.5.
PHP and Apache where installed before and are needed for other applications. 
So, I think, the problem is, that PHP (or: the mysql.so from PHP) still wants to use thelibmysqlclient.so.15 from MySQL5.0.

*Solution needed:*
- How can I tell PHP (or: the mysql.so from PHP) that it should use thelibmysqlclient.so.16 and not thelibmysqlclient.so.15?
- If this is not possible, Can I get thelibmysqlclient.so.15 somewhere?

Thanks a lot!


----------



## gilinko (Mar 2, 2010)

You need to recompile php5-mysql so it will use the currently installed mysql client library and then restart apache.


----------



## DutchDaemon (Mar 2, 2010)

Just reinstall the ports requiring mysql, [cmd=]pkg_info -R mysql\*[/cmd]. Both portupgrade(1) and portmaster(8) have flags for that.

And use 
	
	



```
tags, not [quote] tags for system output.
```


----------



## Sirup (Mar 2, 2010)

Tanks for editing the Quote to Code Tags - I do not have the permissions in the Forum to do it myself.


----------



## DutchDaemon (Mar 2, 2010)

Then simply don't make the mistake  You did receive a welcome email, I believe ...


----------



## Sirup (Mar 3, 2010)

Thanks for your answers.

Unfortunatelly both of the solutions don't work for me:

This happens when I try to recompile php5-mysql

```
[root@boxy /usr/ports/databases/php5-mysql]# make
/libexec/ld-elf.so.1: Shared object "libmysqlclient.so.16" not found, required by "mysql"
===>  php5-mysql-5.2.12 cannot install: unknown MySQL version: .
*** Error code 1
```
But the libmysqlclient.so.16 is in the directory /usr/local/lib/mysql? 

The command pkg_info -R mysql\ tells me:


```
Information for mysql-client-5.5.1:

Required by:
mysql-server-5.5.1

Information for mysql-server-5.5.1:
```


----------



## gilinko (Mar 3, 2010)

I do beleve that some support for the older authentication type has been totally dropped in mysql after the 5.1 version(which is what php5-mysql uses). So you need either do downgrade to at least a mysql version of 5.1 or use the php5-mysqli version.

Start by compiling the php5-mysqli module in ports first and report on how that works.


----------



## Sirup (Mar 4, 2010)

Well, thanks I followed your instructions and it works now... or better said.. now I have a different error, which acutally makes me quite happy!

I tried to recompile mysqli, but this didn't work for me. So I downgraded mysql-server and mysql-client to version 5.0.90! The error is gone!

Unfortunatelly when the browser shows me now:


```
FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'
```

phpinfo() tells me (won't work before)

```
Active Persistent Links  0  
Active Links  0  
Client API version  5.0.90  
MYSQL_MODULE_TYPE  no value  
MYSQL_SOCKET  /tmp/mysql.sock  
MYSQL_INCLUDE  no value  
MYSQL_LIBS  no value
```

I also checked again cacti-configuration - can't find an error.

Also the permissons for the database user must be correct, because I can enter mysql with the user and list all the tables inside.


----------



## Sirup (Mar 4, 2010)

Mabye some additonal information which could be helpful:

Versions:

```
mysql-client-5.0.90 
mysql-server-5.0.90 
php5-extensions-1.3 
php5-mysql-5.2.12 
php5-5.2.12
```

Cacti Configuration in /usr/local/share/cacti/include

```
$database_type = "mysql"; 
$database_default = "cactidb"; 
$database_hostname = "localhost"; 
$database_username = "cactiuser"; 
$database_password = "<mypw>"; 
$database_port = "3306";
```

No errors in the http-error.log.


----------



## gilinko (Mar 4, 2010)

Is mysqld actually running and listening to the local port?

Check the output of the following commands:

```
ps au | grep 'mysqld'
```

Which should show you the following:

```
916 con- I      0:00,01 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-f
  938 con- I      6:05,21 /usr/local/libexec/mysqld --defaults-extra-file=/var/
63225  p0  S+     0:00,00 grep mysqld
```

and


```
sockstat -4 -l | grep mysql
```

Which should show you the following:

```
mysql    mysqld     938   10 tcp4   *:3306                *:*
```

The first one gives you if mysqld is running, the second one gives you if it's listening to the port(3306).


----------



## Sirup (Mar 5, 2010)

My ps aux looks similar:


```
mysql     915  0.0  0.0  7104  1744 con- I     8:29AM   0:00.01 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf --user=mysql --
mysql     937  0.0  0.5 58216 22300 con- I     8:29AM   0:01.00 /usr/local/libexec/mysqld --defaults-extra-file=/var/db/mysql/my.cnf --basedir=/usr/local --d
root     1256  0.0  0.0  7924  1384  p0  S+    9:00AM   0:00.00 grep mysqld
```

Also my sockstat:


```
mysql    mysqld     937   10 tcp4   *:3306                *:*
```

Thanks a lot so far for your ideas!


----------



## Sirup (Mar 9, 2010)

Important rows of my users-table:


```
Host         | User      | password  | ...<more headers>...
localhost    | cactiuser | Hash      | ...<more data>...
```


----------



## gilinko (Mar 9, 2010)

if you can connect to the server using the mysql binary as cactiuser then the problem in in your configuration of the cacti software.

ie: if this works:

```
mysql -u cactiuser -p
```

Then the problem lies in the software connecting to the database, not the database itself. If you can't connect, have you "flushed" the database after adding the new user(ie _flush privileges_)?


----------



## Sirup (Mar 10, 2010)

This works (connects to the DB):


```
mysql -u cactiuser -p
```

I have done flush privileges. Also created a new user und flushed priviliges again 5 minutes again.
Nothing different =/=/
;(


----------



## gilinko (Mar 10, 2010)

The the problem lies with the cacti software, not with mysql. Try running this simple file

```
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
```

Obviously change the _mysql_user_ and _mysql_password_ to the ones in the database. If this works without any problems, then the error is with the cacti software and those are probably best answered in their forum/mailinglist.


----------



## Sirup (Mar 10, 2010)

Tells me: Connected successfully


----------

