Zen Cart Logo
Forums / Upgrading to 1.5.x / PHP Fatal error: 0:DB_ERROR_NOT_CONNECTED

PHP Fatal error: 0:DB_ERROR_NOT_CONNECTED

Views: 4,404

Results 1 to 6 of 6
24 May 2016, 3:55 PM
#1
sammirah avatar

sammirah

Zen Follower

Join Date:
Apr 2012
Location:
Los Angeles, CA
Posts:
185
Plugin Contributions:
2

PHP Fatal error: 0:DB_ERROR_NOT_CONNECTED

PHP Fatal error: 0:DB_ERROR_NOT_CONNECTED :: select * from zen_project_version WHERE project_version_key = 'Zen-Cart Database' in /home/sammirah/public_html/webstore/includes/classes/db/mysql/query_factory.php on line 120

After deleting the zen cart and database then restoring from the last working copy from May 2015 this is what is showing in the logs. Can someone help me with this please?:please:

24 May 2016, 4:09 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: PHP Fatal error: 0:DB_ERROR_NOT_CONNECTED

First why did you restore such an old copy??

Check your 2 configure.php files for valid information paying close attention to the DB details

24 May 2016, 4:44 PM
#3
sammirah avatar

sammirah

Zen Follower

Join Date:
Apr 2012
Location:
Los Angeles, CA
Posts:
185
Plugin Contributions:
2

Re: PHP Fatal error: 0:DB_ERROR_NOT_CONNECTED

I restored that copy after attempting to restore the most recent copies to no avail. It was the best copy before this year. Now I am back to the most recent copy from last week.

Here is the includes/configure.php file:
/**

  • The following settings define your database connection.
  • These must be the SAME as you're using in your non-admin copy of configure.php
    */
    define('DB_TYPE', 'mysql'); // always 'mysql'
    define('DB_PREFIX', 'zen_'); // prefix for database table names -- preferred to be left empty
    define('DB_CHARSET', 'utf8'); // 'utf8' or 'latin1' are most common
    define('DB_SERVER', 'localhost'); // address of your db server
    define('DB_SERVER_USERNAME', 'sammirah_zenc152');
    define('DB_SERVER_PASSWORD', 'XXXXX');
    define('DB_DATABASE', 'sammirah_zenc152');

Here is the admin/includes/configure.php file:

  • The following settings define your database connection.
  • These must be the SAME as you're using in your non-admin copy of configure.php
    */
    define('DB_TYPE', 'mysql'); // always 'mysql'
    define('DB_PREFIX', 'zen_'); // prefix for database table names -- preferred to be left empty
    define('DB_CHARSET', 'utf8'); // 'utf8' or 'latin1' are most common
    define('DB_SERVER', 'localhost'); // address of your db server
    define('DB_SERVER_USERNAME', 'sammirah_zenc152');
    define('DB_SERVER_PASSWORD', 'XXXX');
    define('DB_DATABASE', 'sammirah_zenc152');

What am I missing?

24 May 2016, 4:51 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: PHP Fatal error: 0:DB_ERROR_NOT_CONNECTED

You should change your database password as it was posted briefly but is now removed ...

24 May 2016, 5:37 PM
#5
sammirah avatar

sammirah

Zen Follower

Join Date:
Apr 2012
Location:
Los Angeles, CA
Posts:
185
Plugin Contributions:
2

Re: PHP Fatal error: 0:DB_ERROR_NOT_CONNECTED

Thanks for removing the password for me.

Now is there anything that is missing? What are reasons the database may not be connecting?

24 May 2016, 10:01 PM
#6
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,966
Plugin Contributions:
8

Re: PHP Fatal error: 0:DB_ERROR_NOT_CONNECTED

you should check the cpanel for your host and ensure that the DB USER:

sammirah_zenc152

has access rights to the DB:

sammirah_zenc152

and ensure that the password is correct. or change the password from your cpanel and then change the password in your configure.php files.