Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 21, 2012, 05:42:31 AM

Pages: [1]   Go Down
  Print  
Author Topic: DB Not Connected error  (Read 1025 times)
BrianB
Trekkie
**
Offline Offline

Posts: 10


« on: January 31, 2007, 05:02:31 PM »

Good evening...

We've been operational for many months now using Zen Cart and Fantastico.  I
was notified by a potential customer that our Zen Cart shopping cart was not
functional now. 

When you go to the cart, the user gets the error, "Sorry!
There seems to be a problem connecting to our database. Please give us a few
minutes to remedy the problem. Thank you.".

I then tried to go to Zen Cart admin and I get another error, "0
DB_ERROR_NOT_CONNECTED in:  [select * from GBproject_version WHERE
project_version_key = 'Zen-Cart Database' ]

I went to Zen Cart help which recommended I repair the mySQL database which I
ran from Lunar Pages control panel.  This did not resolve the problem.

Here is what I have in my configuration file...

/ define our database connection
  define('DB_TYPE', 'mysql');
  define('DB_PREFIX', 'GB');
  define('DB_SERVER', 'localhost');
  define('DB_SERVER_USERNAME', 'gotch2');
  define('DB_SERVER_PASSWORD', '******');
  define('DB_DATABASE', 'gotch2_zcu1');
  define('USE_PCONNECT', 'false'); // use persistent connections?
  define('STORE_SESSIONS', 'db'); // use 'db' for best support, or '' for file-based storage

mySQL database looks like this...

Current Databases:
gotch2_sope1   
Users in sope1
gotch2_sope1 (Privileges: ALL PRIVILEGES)

Connection Strings
Perl $dbh = DBI->connect("DBI:mysql:gotch2_sope1:localhost","gotch2_sope1","<PASSWORD HERE>");
PHP $dbh=mysql_connect ("localhost", "gotch2_sope1", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("gotch2_sope1"); 


gotch2_zc1   
Users in zc1
gotch2_zc1 (Privileges: ALL PRIVILEGES)

Connection Strings
Perl $dbh = DBI->connect("DBI:mysql:gotch2_zc1:localhost","gotch2_zc1","<PASSWORD HERE>");
PHP $dbh=mysql_connect ("localhost", "gotch2_zc1", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("gotch2_zc1"); 


gotch2_zcu1   
 
 
 
New Database:   
 

--------------------------------------------------------------------------------
 
Current Users:
gotch2_sope1
gotch2_zc1
 
 
 
I am not very educated on mySQL and couldn't tell you if this is how it was before and something got deleted.  I haven't messed with the site much in several months.  I did have to change my Lunar Pages pass word though.  I'm almost certain it was working after that though.

Can anyone help?

Thanks in advance!





Logged
RandyT
Guest
« Reply #1 on: January 31, 2007, 05:21:15 PM »

BrianB, it looks to me that you are using your cpanel username as the db username... guessing when you changed the password, causing the connection to fail,,,, you should setup a user just for that script, add it to the database, and adjust the script config.

Hope this helps,
RandyT
Logged
BrianB
Trekkie
**
Offline Offline

Posts: 10


« Reply #2 on: January 31, 2007, 06:36:09 PM »

RandyT-

Thanks for your quick response.  You were spot on.  For folks in the same position as me in the futures, here is what I did.

1. Set up a new user in mySQL
2. Attached the user to the database in the ZENCART configure.php script below
3. Edited the configure.php scripts at both file locations public_html/ZenCart/includes and public_html/admin/includes

// define our database connection
  define('DB_TYPE', 'mysql');
  define('DB_PREFIX', 'GB');
  define('DB_SERVER', 'localhost');
  define('DB_SERVER_USERNAME', 'gotch2_admin1');
  define('DB_SERVER_PASSWORD', '****');
  define('DB_DATABASE', 'gotch2_zcu1');
  define('USE_PCONNECT', 'false'); // use persistent connections?
  define('STORE_SESSIONS', 'db'); // use 'db' for best support, or '' for file-based storage

where gotch2_admin1 is a new user name.

Thanks!!

Brian
Logged
RandyT
Guest
« Reply #3 on: January 31, 2007, 07:01:17 PM »

 Applause Glad I could help,  good to hear you got it working now  Thumbs Up


RandyT
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: