0 DB_ERROR_NOT_CONNECTED
DB_ERROR_NOT_CONNECTED occurs when Zen Cart has trouble connecting to your database.
Possible Causes:
-
Your
/includes/configure.phpand/admin/includes/configure.phpfiles specify a prefix for your database tables (DB_PREFIX) which does not match what was used when creating the tables. Not matching the prefix value (or specifying one when it is not needed) is a very common mistake for older installations being upgraded. View your database in phpMyAdmin and see if a prefix is used. The first Zen Cart table should be called (something like)address_book.If it is called
address_book, then yourDB_PREFIXvalue should be''.define('DB_PREFIX', '');If it is called
zen_address_book, then yourDB_PREFIXvalue should be'zen_'.define('DB_PREFIX', 'zen_');If it is called
zcaddress_book, then yourDB_PREFIXvalue should be'zc'.define('DB_PREFIX', 'zc'); -
Your
/includes/configure.phpand/admin/includes/configure.phpfiles contain settings for the database (DB_SERVERDB_SERVER_USERNAME,DB_SERVER_PASSWORD,DB_DATABASE), which are used to log in to the database.The
0 DB_ERROR_NOT_CONNECTEDerror can occur when those database settings no longer match the actual details for the MySQL server, the MySQL database, or the MySQL username+password, or if the database server is broken for some reason.For example, if you recently changed your MySQL username/database/password and didn’t put those same changes into your
configure.phpfiles, you’ll need to update those files to match what’s required by your MySQL database server. -
Some frequently updated tables (such as
sessionsorwhos_onlinecan become corrupt, and cause this problem. Run a “repair” on the database. Most hosts have a Database Repair option listed beside the database names in the webhosting control panel. Ask your host if you need help finding this. -
Talk to your hosting company to determine whether they are doing some sort of maintenance on the database. Tell them that your website cannot connect to your MySQL database, and ask them for some assistance in getting that working again.