Page 1 of 1

"Unable to connect to ZM db.could not find driver"

Posted: Tue Dec 30, 2014 6:33 pm
by DiskCrasher
I've been running ZM v1.27 on openSUSE 13.1 for a long time without issue. I recently upgraded to ZM v1.28 and now the ZM webpage reports "Unable to connect to ZM db.could not find driver". When I rolled back to v1.27 things started working normally again. The new ZM version came from repository liquid-co.de.

Re: "Unable to connect to ZM db.could not find driver"

Posted: Wed Dec 31, 2014 1:44 am
by iconnor
1.28 uses a new php library for db access, because the old one is crap and is deprecated.

you need to look for php-mysqlng

Re: "Unable to connect to ZM db.could not find driver"

Posted: Wed Dec 31, 2014 3:09 am
by DiskCrasher
iconnor wrote:you need to look for php-mysqlng
Unfortunately that package isn't found in the standard openSUSE repositories. The ZM install probably should have failed if this is a required dependency.

Re: "Unable to connect to ZM db.could not find driver"

Posted: Wed Dec 31, 2014 2:47 pm
by knight-of-ni
You are right, the package should have failed during the installation. However neither iconnor nor I maintain the rpm package for OpenSuse so we can't fix it.

The best thing to do is to contact the package maintainer. We will be glad to work the maintainer if he/she has any questions.

The package maintainers e-mail address should be in the changelog. To view it do the following:

Code: Select all

rpm -q --changelog <packagename> | less

Re: "Unable to connect to ZM db.could not find driver"

Posted: Sat Jan 03, 2015 4:34 pm
by monex
Hello,
I've tried to reproduce this problem but I had no success. On my System (openSuSE 13.1) the webfrontend works without any problems.

I think I need more info. Can you try to create a phpinfo page as described here http://php.net/manual/de/function.phpinfo.php and look at the "mysql" section.

On my System it looks like this:
Image

It uses mysqlnd so it looks OK here.

I have the following php5 packages installed:

Code: Select all

rpm -qa | grep php5

php5-xmlwriter-5.4.20-34.3.x86_64
php5-pdo-5.4.20-34.3.x86_64
php5-json-5.4.20-34.3.x86_64
php5-dom-5.4.20-34.3.x86_64
php5-mcrypt-5.4.20-34.3.x86_64
php5-mysql-5.4.20-34.3.x86_64
php5-zip-5.4.20-34.3.x86_64
php5-iconv-5.4.20-34.3.x86_64
php5-xmlreader-5.4.20-34.3.x86_64
php5-sockets-5.4.20-34.3.x86_64
php5-ctype-5.4.20-34.3.x86_64
php5-mbstring-5.4.20-34.3.x86_64
php5-sqlite-5.4.20-34.3.x86_64
php5-gd-5.4.20-34.3.x86_64
php5-5.4.20-34.3.x86_64
php5-bz2-5.4.20-34.3.x86_64
php5-zlib-5.4.20-34.3.x86_64
php5-tokenizer-5.4.20-34.3.x86_64
apache2-mod_php5-5.4.20-34.3.x86_64
Please try to verify if you are using the same versions (or post back the result of the above command).

Greetings,
Dirk

Re: "Unable to connect to ZM db.could not find driver"

Posted: Sat Jan 03, 2015 5:38 pm
by DiskCrasher
The output of both on my system look identical to yours:

Code: Select all

rpm -qa | grep php5             
apache2-mod_php5-5.4.20-34.3.x86_64
php5-5.4.20-34.3.x86_64
php5-dom-5.4.20-34.3.x86_64
php5-json-5.4.20-34.3.x86_64
php5-pdo-5.4.20-34.3.x86_64
php5-xmlwriter-5.4.20-34.3.x86_64
php5-mysql-5.4.20-34.3.x86_64
php5-mbstring-5.4.20-34.3.x86_64
php5-ctype-5.4.20-34.3.x86_64
php5-sockets-5.4.20-34.3.x86_64
php5-zip-5.4.20-34.3.x86_64
php5-iconv-5.4.20-34.3.x86_64
php5-sqlite-5.4.20-34.3.x86_64
php5-mcrypt-5.4.20-34.3.x86_64
php5-tokenizer-5.4.20-34.3.x86_64
php5-xmlreader-5.4.20-34.3.x86_64
php5-zlib-5.4.20-34.3.x86_64
php5-bz2-5.4.20-34.3.x86_64
php5-gd-5.4.20-34.3.x86_64

Re: "Unable to connect to ZM db.could not find driver"

Posted: Mon Jan 05, 2015 7:56 pm
by monex
Hello,

that's strange, I don't have this problem.

Can you please paste the output of

Code: Select all

php -i | grep mysql
mysql --version
Maybe this gives some hint about this issue.

Re: "Unable to connect to ZM db.could not find driver"

Posted: Tue Jan 06, 2015 1:13 am
by DiskCrasher

Code: Select all

php -i | grep mysql
/etc/php5/conf.d/mysql.ini,
/etc/php5/conf.d/mysqli.ini,
/etc/php5/conf.d/pdo_mysql.ini,
mysql
Client API version => mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $
mysql.allow_local_infile => On => On
mysql.allow_persistent => Off => Off
mysql.connect_timeout => 60 => 60
mysql.default_host => no value => no value
mysql.default_password => no value => no value
mysql.default_port => no value => no value
mysql.default_socket => /var/run/mysql/mysql.sock => /var/run/mysql/mysql.sock
mysql.default_user => no value => no value
mysql.max_links => Unlimited => Unlimited
mysql.max_persistent => Unlimited => Unlimited
mysql.trace_mode => Off => Off
mysqli
Client API library version => mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $
mysqli.allow_local_infile => On => On
mysqli.allow_persistent => Off => Off
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => /var/run/mysql/mysql.sock => /var/run/mysql/mysql.sock
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
mysqlnd
mysqlnd => enabled
Version => mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $
Loaded plugins => mysqlnd,example,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password
API Extensions => mysql,mysqli,pdo_mysql
mysqlnd statistics =>  
PDO drivers => mysql, sqlite
pdo_mysql
Client API version => mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $
pdo_mysql.default_socket => /var/run/mysql/mysql.sock => /var/run/mysql/mysql.sock

Code: Select all

mysql --version
mysql  Ver 15.1 Distrib 5.5.33-MariaDB, for Linux (x86_64) using readline 5.1

Re: "Unable to connect to ZM db.could not find driver"

Posted: Tue Jan 06, 2015 8:01 pm
by monex
Hi,

there is no difference to my test installation here.

I really have no idea what could be the cause for this issue.
Maybe it would help to reinstall all php5 packages and restart apache2.

Code: Select all

zypper in -f $(rpm -qa | grep php5)

systemctl restart apache2.service
Did you upgrade your openSUSE 13.1 installation from a previous version or was it a fresh install?

Re: "Unable to connect to ZM db.could not find driver"

Posted: Thu Jan 08, 2015 2:03 am
by DiskCrasher
It was an upgrade from a prior version, but that was a while ago.

Re: "Unable to connect to ZM db.could not find driver"

Posted: Sun Feb 15, 2015 7:33 pm
by Optimist
Has anyone found a solution to this problem?

I have a SuSe 13.1 system that won't let me access the web interface after updating to Version 1.28.0. ZoneMinder continues to run and seems to be recording images, just no web access.

I also have a similar system that upgraded perfectly.

Re: "Unable to connect to ZM db.could not find driver"

Posted: Mon Feb 16, 2015 3:42 am
by knight-of-ni
We had a user report the same error message on his Arch Linux distro over on github.
https://github.com/ZoneMinder/ZoneMinder/issues/437

Looks like he discovered the PDO driver was disabled in his php.ini.
Something to check on your system if you have not already.

Re: "Unable to connect to ZM db.could not find driver"

Posted: Wed Feb 18, 2015 4:13 pm
by tcake
I encountered this under Centos 7, it did get fixed by using yum to remove PHP-MYSQL and installing PHP-MYSQLND

Re: "Unable to connect to ZM db.could not find driver"

Posted: Thu Feb 19, 2015 2:33 am
by DiskCrasher
Not that this solves the problem but I finally said the heck with it and installed Windows in a VM along with iSpy. Much nicer software.