Forums / General Questions / Can't connect to my database.

Can't connect to my database.

Locked

Views: 10,252

Results 1 to 20 of 33
This thread is locked. New replies are disabled.
30 Dec 2007, 10:02 AM
#1
misty16 avatar

misty16

Zen Follower

Join Date:
Sep 2006
Posts:
111
Plugin Contributions:
0

Can't connect to my database.

Hi, I have read through almost every post i could find and and tried all what they have said and have had no luck so I thought I'd write in my problem...

My host has recently changed me from one server to another server....My shop was working great before that.....Until the change over........I do run with a control panel...............But my home page comes up with now nddbc.html page saying can not connect to data base..............My admin has this error.............
0 DB_ERROR_NOT_CONNECTED
in:
[delete from zen_db_cache]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

I just don't understand.................In my control panel it does show the data bases...........Any clues on how to help me or maybe point me in the right direction.................I am even will to let one of the zencart administrators have a look in all my settings to see if you can see the problem.. I do hope someone can help.................My business has been out of action for 12 days now and I am loosing so much money and sales............My host has said they have done everything they could but that is not good enough when they created this mess...................PLEASE HELP:cry::cry::cry:

30 Dec 2007, 11:41 AM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Can't connect to my database.

Assuming they didn't change your database name, username or password (which would be plain daft and rather obvious), it is most likely that they are using an explicit path to the server where your database is being held (rather than a generic one like localhost).

As that path has changed, your includes/configure.php and admin/includes/configure.php files need to be changed to reflect the new information.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

30 Dec 2007, 11:51 AM
#3
misty16 avatar

misty16

Zen Follower

Join Date:
Sep 2006
Posts:
111
Plugin Contributions:
0

Re: Can't connect to my database.

How would I find out the correct information to enter that into the configure.php files...........I looked everywhere and can't seem to find it.

30 Dec 2007, 12:07 PM
#4
misty16 avatar

misty16

Zen Follower

Join Date:
Sep 2006
Posts:
111
Plugin Contributions:
0

Re: Can't connect to my database.

This is my Configure.php file....................do you see any thing that should not be there.................:frusty:

define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');
define('DIR_WS_PHPBB', '/');
// * DIR_FS_* = Filesystem directories (local/physical)
//the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
define('DIR_FS_CATALOG', '/home/precutdi/public_html/mystore/');
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/');
define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);
define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');
// define our database connection
define('DB_TYPE', 'mysql');
define('DB_PREFIX', 'zen_');
define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty
define('DB_SERVER_USERNAME', 'mystore');
define('DB_SERVER_PASSWORD', 'mypassword');
define('DB_DATABASE', 'mystore');
define('USE_PCONNECT', false); // use persistent connections?
define('STORE_SESSIONS', 'db'); // leave empty '' for default handler or set to 'db'
// The next 2 "defines" are for SQL cache support.
// For SQL_CACHE_METHOD, you can select from: none, database, or file
// If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache
// or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
// ie: /path/to/your/webspace/public_html/zen/cache -- leave no trailing slash
define('SQL_CACHE_METHOD', 'database');
define('DIR_FS_SQL_CACHE', '/home/precutdi/public_html/mystore/cache');

30 Dec 2007, 12:24 PM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Can't connect to my database.

What I'm suspecting is that following the move of your database to another server, you may need to put something more explicit in this line> define('DB_SERVER', 'localhost');

However, the only people who can truly know what needs to go in this and the other lines nearby, is your web host as they are the ones who have configured your account.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

30 Dec 2007, 12:48 PM
#6
misty16 avatar

misty16

Zen Follower

Join Date:
Sep 2006
Posts:
111
Plugin Contributions:
0

Re: Can't connect to my database.

Thanks for that.................I have had more help from you in 1 hour then I have from them in 12 days.................

I will get in contact with them to find out what does need to be there.

Thanks Heaps, Hopefully that works.

I shall be back.............

30 Dec 2007, 1:18 PM
#7
misty16 avatar

misty16

Zen Follower

Join Date:
Sep 2006
Posts:
111
Plugin Contributions:
0

Re: Can't connect to my database.

Ok I am back...................Could you please translate this in english for me............I know some things about this but I need a little help here.......

This is what my server had to say. Plus I'm not sure of any welcome email. Should I have received one with the change over?

The configure.php uses the server name as localhost , so probably you do not need to change it. Only if in mysql server you have mentioned the hostname as IP of server , then you need to replace it with new server IP as provided in welcome email.

30 Dec 2007, 1:29 PM
#8
misty16 avatar

misty16

Zen Follower

Join Date:
Sep 2006
Posts:
111
Plugin Contributions:
0

Re: Can't connect to my database.

Hi again,

They did send through this email

The new server IP is ..., since you have used localhost, you need not change anything in configure.php

(not sure if I should have written the IP in there or not)

I have put this IP in that server section and that doesn't work.........

So what do I do now?

30 Dec 2007, 1:36 PM
#9
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Can't connect to my database.

There's no harm in putting the IP address in. What you would need to do now is double check your database name, username and password. If any one of these is off, it will prevent a connection. If all four (inc IP address) is correct, then the database server must be unavailable.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

30 Dec 2007, 1:39 PM
#10
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Can't connect to my database.

One other thing to check is that any changes to your configure files are arriving safely. They're write protected, so some FTP programs simply and silently turn away and the changes don't actually happen.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

30 Dec 2007, 1:40 PM
#11
misty16 avatar

misty16

Zen Follower

Join Date:
Sep 2006
Posts:
111
Plugin Contributions:
0

Re: Can't connect to my database.

Do I just check these in my configure.php file or is there another place that has this information?

As in my control panel I can see the username but not any passwords.

30 Dec 2007, 1:42 PM
#12
misty16 avatar

misty16

Zen Follower

Join Date:
Sep 2006
Posts:
111
Plugin Contributions:
0

Re: Can't connect to my database.

oh ok.............how would I make them so they could be written.

30 Dec 2007, 3:52 PM
#13
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Can't connect to my database.

misty16:

Do I just check these in my configure.php file or is there another place that has this information?

As in my control panel I can see the username but not any passwords.The aim is to ensure that what is in your configure.php files matches what your database and hosting account are expecting. It's not possible for us to tell you how to find these out, as different web hosts configure their set ups differently and offer different tools to accessing them.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

30 Dec 2007, 3:55 PM
#14
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Can't connect to my database.

misty16:

oh ok.............how would I make them so they could be written.Sometimes this can be done via your FTP software, sometimes it has to be done via your web hosts control panel. Depending upon which FTP software you are using and what your web host allows / offers.

Personally I usually delete the configure.php files on my server using my FTP software (FileZilla) immediately before uploading new files. That way there's no doubt about whether they got updated or not.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

30 Dec 2007, 4:33 PM
#15
misty16 avatar

misty16

Zen Follower

Join Date:
Sep 2006
Posts:
111
Plugin Contributions:
0

Re: Can't connect to my database.

Thanks for your reply........I did try that by deleting the file first......No luck there.............I really do think the problem is at my host...........As miraculously they have restored my gallery.............go figure......

I am going the long way around..............I have installed a new web address and installed zencart on there.........I have downloaded all the new files.................Now I'm in the process of uploading my originals site files that I had as back up.................So far all is working but this is just a bandaid.............as the original site is stil out of action.............I suppose it's a good thing I am doing this as I will always have a back up site to redirect customers too.

Thanks for all your help, you have given me some great conclusions that I can always come back to.

31 Dec 2007, 1:39 PM
#16
misty16 avatar

misty16

Zen Follower

Join Date:
Sep 2006
Posts:
111
Plugin Contributions:
0

Re: Can't connect to my database.

:clap::clap::clap:

I just thought that I would post this conclusion as it may help someone else......

After the issues I had with the upgrading the server and getting these 0 database errors....

I did do another install of zencart and with this new install I did get alot of errors also...............I just thought I'd try adding the new user I had just created to my old stores msql database.....I made sure I took notes of the username and passwords...........which can also be found in the new stores includes/configure.php file and admin/includes/configure.php file....

I then added this new username and password to my old stores includes/configure.php file and admin/includes/configure.php file....

And HOLY COW it worked............My store is now back up and running............I hope this may help someone else...........I know after 4 days of sitting at this computer trying to work it out, I'm off to have a bite to eat and a cuppa.

31 Dec 2007, 1:42 PM
#17
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Can't connect to my database.

Glad to hear you got there. Sounds as though your database user password had gotten messed up in the transfer. Congrats on the persistence that saw you through.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

12 Oct 2010, 10:16 PM
#18
sushilmishra avatar

sushilmishra

New Zenner

Join Date:
Aug 2010
Posts:
15
Plugin Contributions:
0

Re: Can't connect to my database.

Hi Guys,

:oops: I've ran into the exact same problem..but unable to sort it out.. I've checked out every single thing which has been mentioned above..but no luck as of now.. :frusty:
pls help me out !!! :frusty:

Thanx in advance,

Sushil

12 Oct 2010, 11:04 PM
#19
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Can't connect to my database.

Have you checked with your webhost whether they changed your database access credentials during your server move Or if your database access is not via localhost, whether they changed the database server?

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

13 Oct 2010, 7:16 AM
#20
sushilmishra avatar

sushilmishra

New Zenner

Join Date:
Aug 2010
Posts:
15
Plugin Contributions:
0

Re: Can't connect to my database.

Yes the username was changed..and that is why the database also changed (i mean the prefix of the database)

I've tried changing the username and password in the congifure.php file in includes/configure.php and admin/includes/configure.php
but to no use.. :frusty:

I'm really worried and dont know what to do...I've worked on this for a long time and cant afford to lose it :frusty: