PHP Classes

All Databases and Error on 3rd Database

Recommend this page to a friend!

      PHP Multi MySQLDump  >  All threads  >  All Databases and Error on 3rd Database  >  (Un) Subscribe thread alerts  
Subject:All Databases and Error on 3rd Database
Summary:Need ability to get all databases on a server and error.
Messages:2
Author:Theodis Butler
Date:2017-04-13 16:06:10
 

  1. All Databases and Error on 3rd Database   Reply   Report abuse  
Picture of Theodis Butler Theodis Butler - 2017-04-13 16:06:10
Greetings and thank you for creating such a wonderful script.

One of my database servers has 42 individual databases, I wish there was a way to add them all using a method in this class. Then maybe exclude some tables like 'mysql' and/or 'performance_schema'.

For some reason, when I try to add a 3rd instance I get the following error (HTTP CODE 500):

2017/04/13 15:54:49 [error] 30046#30046: *33007 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function fetchAll() on boolean in /var/www/html/backup.xxx.net/public_html/Class.MapQuery.php:103
Stack trace:
#0 /var/www/html/backup.xxx.net/public_html/Class.MultiDump.php(373): MapQuery->select('SHOW FULL TABLE...')
#1 /var/www/html/backup.xxx.net/public_html/index.php(190): MultiDump->setListTablesToDump('gocourt')
#2 {main}
thrown in /var/www/html/backup.xxx.net/public_html/Class.MapQuery.php on line 103" while reading response header from upstream, client: 127.0.0.1, server: backup.xxx.net, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "backup.xxx.net"

  2. Re: All Databases and Error on 3rd Database   Reply   Report abuse  
Picture of Alessandro Quintiliani Alessandro Quintiliani - 2017-04-14 07:23:01 - In reply to message 1 from Theodis Butler
Hello Theodis

thank you for the compliments. Your suggestion about one method to dump all databases from a server is notable; I could think to implement, maybe adding an extra level to process many databases in parallel.

As to the error, it seems as the query executed in Class.MapQuery.php at line 101 returns a boolean value instead of an object reference.
According to the PHP manual for PDO::query, a call to PDO::query() returns a PDO Statement object, or FALSE on failure.
Make sure that:

1) the PDO connection to the 3rd database is successfully established

2) try to manually execute (using any MySQL client) the query which brings up the fatal error: maybe you can activate another class of mine LogDeltaTime (read the ending part of the README.md file in Multi MySQLDump package to know how to do that) to track on a log file each statement and check where the problem arises.

Best regards

Alessandro Quintiliani