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

Forum for questions and support relating to the 1.28.x releases only.
Locked
DiskCrasher
Posts: 8
Joined: Sun Oct 21, 2012 11:46 pm

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

Post 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.
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

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

Post 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
DiskCrasher
Posts: 8
Joined: Sun Oct 21, 2012 11:46 pm

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

Post 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.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

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

Post 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
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
User avatar
monex
Posts: 169
Joined: Mon Jan 22, 2007 1:10 pm

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

Post 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
Image
DiskCrasher
Posts: 8
Joined: Sun Oct 21, 2012 11:46 pm

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

Post 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
User avatar
monex
Posts: 169
Joined: Mon Jan 22, 2007 1:10 pm

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

Post 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.
Image
DiskCrasher
Posts: 8
Joined: Sun Oct 21, 2012 11:46 pm

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

Post 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
User avatar
monex
Posts: 169
Joined: Mon Jan 22, 2007 1:10 pm

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

Post 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?
Image
DiskCrasher
Posts: 8
Joined: Sun Oct 21, 2012 11:46 pm

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

Post by DiskCrasher »

It was an upgrade from a prior version, but that was a while ago.
Optimist
Posts: 11
Joined: Sun Sep 11, 2011 9:17 am

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

Post 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.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

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

Post 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.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
tcake
Posts: 2
Joined: Sat Jan 31, 2015 10:46 pm

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

Post by tcake »

I encountered this under Centos 7, it did get fixed by using yum to remove PHP-MYSQL and installing PHP-MYSQLND
DiskCrasher
Posts: 8
Joined: Sun Oct 21, 2012 11:46 pm

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

Post 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.
Locked