Forums / General Questions / Database problems

Database problems

Locked

Views: 1,321

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
3 Nov 2009, 6:48 PM
#1
jo_h1971 avatar

jo_h1971

New Zenner

Join Date:
Oct 2009
Posts:
33
Plugin Contributions:
0

Database problems

Hello

Hoping someone may be able to help!

I am having a similar issue to the person in this thread http://www.zen-cart.com/forum/showthread.php?t=50603 as I see two databases when I look at the admin.configure.php file and admin/includes/configure.php

I am no longer able to access one of the databases as we were having lots of problems with the host and then moved hosts. I think that the website is still picking up the products from the database that I cannot get in to so how can I update and backup the database if I can't get to it at all?!

Thanks in advance

3 Nov 2009, 8:12 PM
#2
jammin320 avatar

jammin320

Zen Follower

Join Date:
Mar 2007
Location:
Seattle, WA
Posts:
158
Plugin Contributions:
0

Re: Database problems

If your two config files are showing two different databases, then you certainly have an issue. They both should be pointed to the same DB. You will want to figure out which one is correct (probably by checking the behavior in your store), and make the appropriate adjustments.

As far as accessing the database, that is something that you will likely need to work out with your hosting company. They will have the information to allow you to access the database directly.

3 Nov 2009, 8:33 PM
#3
jo_h1971 avatar

jo_h1971

New Zenner

Join Date:
Oct 2009
Posts:
33
Plugin Contributions:
0

Re: Database problems

Hi Ben

Thanks for your reply.

Thats the problem in a nutshell! The database is pointing to a host that I cannot contact anymore and have no access to. Is there anyway at all that I can do a back up of it somehow so I can move it to my new host?

Thanks for your help

3 Nov 2009, 8:37 PM
#4
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Database problems

The database information in the config files should match. Do you know which one is correct?

If you didn't back up the database before the move, I doubt you can do it now.

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

3 Nov 2009, 8:47 PM
#5
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Database problems

If what you are saying is that the present install is using the old database then actually there might be hope. But to be honest this seems quite unlikely.

So:

Find out for sure which database is being used by the present install as it stands at this moment. Find out for sure before you do anything else.

Your present host should be able to give you access to the new database via phpMyAdmin (or a similar tool) Use that to really assure yourself that it is not the new database that is being used.

Nick
iszent.com

3 Nov 2009, 8:59 PM
#6
jo_h1971 avatar

jo_h1971

New Zenner

Join Date:
Oct 2009
Posts:
33
Plugin Contributions:
0

Re: Database problems

Wow everyone thanks for the replies.

How would I find out for definite which database is being used?

The admin/configure.php and admin/includes/configures.php database entries are definitely different.

Thank you so much again

3 Nov 2009, 9:06 PM
#7
jo_h1971 avatar

jo_h1971

New Zenner

Join Date:
Oct 2009
Posts:
33
Plugin Contributions:
0

Re: Database problems

Come to think about it, the new host backed up the files and then transferred them themselves. I am nearly 100% sure that the database is still being hosted by the old hosts because we sometimes get the 0_db error not connected message and when I have contacted the new hosts about it, they said it is because it is still being hosted elsewhere

3 Nov 2009, 9:10 PM
#8
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Database problems

Questions:

What makes you think it is the old database that is being used? This is very very unlikey.

What did you do when you moved the site? Was the database exported in any way?

Can you find out from your present host how to access the database directly? As I said you are looking for phpMyAdmin or a similar tool. If you can do this then just change a bit of data, for instance a product name, in the database and see if that change is reflected in the shop. If it is then the new database is being used.

Nick
iszent.com

3 Nov 2009, 9:13 PM
#9
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Database problems

so, if the database was exported, then what is the problem with just making sure the new database is used?

Why do you want to try to export the old database again?

Surely you just want to make the configure files both point towards the new database?

Nick

Nick
iszent.com

3 Nov 2009, 9:15 PM
#10
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Database problems

And when did you transfer the site? How long ago?

Nick
iszent.com

3 Nov 2009, 9:28 PM
#11
jo_h1971 avatar

jo_h1971

New Zenner

Join Date:
Oct 2009
Posts:
33
Plugin Contributions:
0

Re: Database problems

Hi Nick

Thanks so much for taking the time and trouble to help.

The site was hosted by a company who have been mentioned in several other threads on this site. Basically the site went down one day and we couldn't contact the hosts to get the site back up. We found another host and they managed to do a back up and transferred all the files so the site was up and running again, we didn't do any of it ourselves as we didn't know how to!

We switched hosts in Feb last year.

The new site is now hosted on a Plesk basis and although I have found the database on there, I cannot currently access that as that looks like it is password protected.

This is the info on the admin/configure.php

// define our database connection
define('DB_TYPE', 'mysql');
define('DB_PREFIX', '');
define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty
define('DB_SERVER_USERNAME', '_');
define('DB_SERVER_PASSWORD', '');
define('DB_DATABASE', '
_****');
define('USE_PCONNECT', 'false'); // use persistent connections?
define('STORE_SESSIONS', 'db'); // leave empty '' for default handler or set to 'db'

and this is the info on admin/includes/configure.php

// define our database connection
define('DB_TYPE', 'mysql');
define('DB_PREFIX', '');
define('DB_SERVER', '..co.uk'); // eg, localhost - should not be empty
define('DB_SERVER_USERNAME', '_');
define('DB_SERVER_PASSWORD', '
***');
define('DB_DATABASE', '
_****');
define('USE_PCONNECT', 'false'); // use persistent connections?
define('STORE_SESSIONS', 'db'); // leave empty '' for default handler or set to 'db'

Does this info help at all?

3 Nov 2009, 9:47 PM
#12
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Database problems

OK.

Well, the 'localhost' is a bit meaningless becuase that could be any host.

The other one on the other hand is specific to a host. Is this the new host or the old host? Do you know? Are you hosted by that company or is that the old company? It has the address of a hosting company after the first '.' and before the '.co.uk' so if this is the current hosting company then you should be able to tell us.

Nick
iszent.com

3 Nov 2009, 9:53 PM
#13
jo_h1971 avatar

jo_h1971

New Zenner

Join Date:
Oct 2009
Posts:
33
Plugin Contributions:
0

Re: Database problems

Hi Nick

The first one is where I "think" the database still is. The second one is the host that we moved to. Like I said I cannot access the database with the new host because although I have found where it is it looks as though it is password protected.

Thank you again

3 Nov 2009, 10:09 PM
#14
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Database problems

No, I don't think that can be the case. Localhost is not taking you off server. I think that you are mistaken about the site using the old database.

If you really want to check then I would contact your present hosting and ask them how to get to phpMyAdmin for your new database (they say they have 24/7 support). They say they do not use cPanel which is the most common control panel so I can't give you advice.

Once you get into phpMyAdmin making a small change to a product name (like adding an X to the end of the name) is easy. Then you can see if this change is reflected in the site. That way you have confirmed which database is being used. I'll put money on it being the new one!

Then you go back to the post by Afo. Both entries need to be the same. 'localhost' sometimes works where it isn't meant to but it directs to the localhost not a remote server. I have known that to happen on apache anyway.

So, the final step, once you have proved to yourself that it is the new database that is being used is to check with the hosting company exactly what the database address should be and make sure that both configure.php files reflect this.

Nick
iszent.com