System: Windows 8
I have been working on a project for school using IBM DB2 Express-C, Xampp, and PHP to access the database.
Everything has been working perfectly. Then one day I rebooted my computer.
IBM Database Manager returned the following error at startup:
SQL5005C The operation failed because the database manager failed to access either the database manager configuration file or the database configuration file.
I have tried running db2stop and db2start.
I am still able to access my database via the db2 command line terminal as if nothing is wrong.
However, when I try to access my database from PHP I now get the following error from my PHP file:
58031 [IBM][CLI Driver] SQL1031N The database directory cannot be found on the indicated file system. SQLSTATE=58031 SQLCODE=-1031
You might want to double check the db2diag.log to find the reason for SQL5005C
. In the better case there was a temporary problem accessing the configuration files. However, in the worse case one of the DBM or DB configuration files may have become corrupt. In the case of a corrupt DBM CFG, I usually use db2idrop
/db2icrt
. A corrupt DB CFG can be "fixed" (as in "reset", you will lose all custom changes) by RESET DB CFG
.
The subsequent SQL1031N
tells me the database you are trying to access has been uncataloged. This is also odd, especially since you are telling me you are able to access the database from the DB2 command line. You might want to do LIST DB DIRECTORY
from your command line to show your database entries, and also LIST NODE DIRECTORY
to see which nodes the databases reside on.
The possible reason is that you lost the database files on your hard disk.
When you try to interact with DB2 from a programming language (PHP, python or others) you use a library (example ibm_db for python) that interact with a db2 client application to connect/query your DB.
If you have more than one IBM Data Server client packages installed on your workstation you might not use the right one to access your DB.
So you have to verify which client your PHP api has using to do this job. To do this:
You can find more information about the management of more db2 client on the same machine here