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

Can't connect to my database.

Locked

Views: 10,252

Results 21 to 33 of 33
This thread is locked. New replies are disabled.
13 Oct 2010, 7:18 AM
#21
sushilmishra avatar

sushilmishra

New Zenner

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

Can't connect to my database.

I'm getting a blank screen for the store..

and when i try to access the admin,it says :

0 DB_ERROR_NOT_CONNECTED
in:
[select * from zen_project_version WHERE project_version_key = 'Zen-Cart Database' ]
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.

13 Oct 2010, 7:36 AM
#22
sushilmishra avatar

sushilmishra

New Zenner

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

Re: Can't connect to my database.

Lemme explain the whole issue properly which would help you to understand what i did..

  1. I had the complete back up of the data from my previous hosting server before it went down.
  2. Now in the new server.. I installed Zen cart using fantastico de luxe...
    the name i gave to that folder was "store" (which is the same as the previous one)
  3. the new zencart installation is the new one V 1.3.9 g but mine was a lil older one.. i guess.. 1.3.9 b or 1.3.8 b (not sure)
  4. What I did was, extract all the previous data to this new folder..
  5. when i tried to access the store by typing the url...it said that the installation is new so asked to me add the zc_install folder..and even edi my configure.php file

which i did...

NOW what i'm left with is :

  • when i try to access my store from url..it shows a blank page

  • when i try to log into admin..it shows the error mentioned above..

plz help..

13 Oct 2010, 7:47 AM
#23
spid3r1987 avatar

spid3r1987

Zen Follower

Join Date:
Jul 2009
Posts:
497
Plugin Contributions:
0

Re: Can't connect to my database.

MAKE SURE YOU CREATE A BACKUP BEFORE DOING ANY WORK!!!

sushilmishra:

Lemme explain the whole issue properly which would help you to understand what i did..

  1. I had the complete back up of the data from my previous hosting server before it went down.
  2. Now in the new server.. I installed Zen cart using fantastico de luxe...
    the name i gave to that folder was "store" (which is the same as the previous one)
  3. the new zencart installation is the new one V 1.3.9 g but mine was a lil older one.. i guess.. 1.3.9 b or 1.3.8 b (not sure)
  4. What I did was, extract all the previous data to this new folder..
  5. when i tried to access the store by typing the url...it said that the installation is new so asked to me add the zc_install folder..and even edi my configure.php file

which i did...

NOW what i'm left with is :

  • when i try to access my store from url..it shows a blank page

  • when i try to log into admin..it shows the error mentioned above..

plz help..

MAKE SURE YOU CREATE A BACKUP BEFORE DOING ANY WORK!!!

did you do an SQL backup of your old server before moving to the new server?
have you checked the database NAME?
did you set any prefix's for the database tables?
some hosting companies use "prefixs" for the username
for example
your login id is fred1
so when u create a database user called monkey
it creates it as fred1_monkey
if u follow me....
so check database name, username, password, then DOUBLE CHECK THEM...
check database prefix's
if it has a prefix to your DB
in your configure file(include>config)
near the bottom there is

define('DB_PREFIX', ''); // prefix for database table names -- preferred to be left empty

enter ur DB prefix in there

i may not know how yet, but i soon will....i hope :)

13 Oct 2010, 7:50 AM
#24
spid3r1987 avatar

spid3r1987

Zen Follower

Join Date:
Jul 2009
Posts:
497
Plugin Contributions:
0

Re: Can't connect to my database.

MAKE SURE YOU CREATE A BACKUP BEFORE DOING ANY WORK!!
MAKE SURE YOU CREATE A BACKUP BEFORE DOING ANY WORK!!!
after completing these steps above
go through your configure file and make sure the hosting directory's are all correct
your old hosting might be
/home/fred1/public_html/shop

but your new hosting could be/home/fr/ed/1/public_html

or the alternative is to wipe the website, do a fresh install, install it all including sample products etc
then copy the files back over, EXCLUDING the configure.php's

BUT MAKE SURE YOU CREATE A BACKUP BEFORE DOING ANY WORK!!!

i may not know how yet, but i soon will....i hope :)

13 Oct 2010, 9:07 AM
#25
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.

@sushilmishra

That doesn't sound much like the "exact same problem" that was described earlier in the thread, so we need all the information about what you have done.

In particular, how and when did you upload your old database to your new one? you tell us only about extracting the "data" to the new folder, which sounds like copying your Zen Cart files into the right place (unless you have direct access to the mysql folders - in which case it's unlikely you would have used Fantastico to install Zen Cart), but nothing about how your restored your database.

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, 9:10 AM
#26
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.

P.S.

I think that you and spid3r1987 may be using the same terminology for different things in respect of database prefixes.

I believe that you're referring to the account name used to prefix your database name in most hosting accounts and he's talking about the optional prefix that you may or may not have used for your table names inside your database.

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, 9:21 AM
#27
spid3r1987 avatar

spid3r1987

Zen Follower

Join Date:
Jul 2009
Posts:
497
Plugin Contributions:
0

Re: Can't connect to my database.

kuroi:

P.S.

I think that you and spid3r1987 may be using the same terminology for different things in respect of database prefixes.

I believe that you're referring to the account name used to prefix your database name in most hosting accounts and he's talking about the optional prefix that you may or may not have used for your table names inside your database.

too many prefix's in this thing lol
DB prefix = fred1_database
table prefix = prefix_address_book

please correct if im wrong way round kuroi :D

i may not know how yet, but i soon will....i hope :)

13 Oct 2010, 11:24 AM
#28
sushilmishra avatar

sushilmishra

New Zenner

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

Re: Can't connect to my database.

@ kuroi & spid3r1987

I'l give you the details of what i did :

  1. i copied all the files from "/public_html/" folder before my previous server went down. I zipped all the data and and made a backup of that in my comp.

  2. when i was provided the new server space..i was given a new user id and pswd...
    yes the database too comes with a prefix of the user id.

  3. now in my new server space,i installed zen cart using fantastico.. the folder i named "store"

  4. after installing that.. I uploaded the zipped folder of my back up data and extracted it there on the server

  5. i edited the configure.php in "/store/includes/" and "/store/admin/includes/" accordingly..i made a note of the user id and password previously itself..

and this is how i ended up havin this problem..
I've tried all those which you've advised me to..

one lil question..how exactly do i make the back up of the database ??? i'm usin linux server..cpanel

13 Oct 2010, 11:30 AM
#29
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.

I hate to break this to you, but I'm not seeing anything in the steps that you took that suggests you backed up your database from the old server and restored it to the new one. Your database is not located in the public_html area of your account, but elsewhere on the server (or for shared hosting sometimes even on a completely different server dedicated to hosting databases).

If you're using cPanel then you almost certainly have phpMyAdmin which can be used to export databases from one server/account and import them to another. That's not the only way of doing it, but is probably the most common.

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, 11:50 AM
#30
sushilmishra avatar

sushilmishra

New Zenner

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

Re: Can't connect to my database.

GOSH !!!! :shocking:

I jus now remembered that !!! phpadmin was completely off my mind..

and i did not back up my data from there :cry:

I messed it up big time !!!

well apart from the database..is it still possible to get the rest of my site back on ????

the database must be havin only the data of the products and thier images right ???

What i'm more concerned about is the load of the .php pages which i altered to suit me..

so is there a way to jus get all those things on ???

13 Oct 2010, 11:58 AM
#31
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.

Yes, you will have all your php file changes in your backup of public_html.

But before you give up on your database, do you have any older backups of it that would at least get you some way back?

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, 12:05 PM
#32
sushilmishra avatar

sushilmishra

New Zenner

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

Re: Can't connect to my database.

well, apart from the database, i have the back of all the files from "public_html" folder...

pls advice on how do i restore these..without makin any other blunders.. :(

13 Oct 2010, 4:10 PM
#33
sushilmishra avatar

sushilmishra

New Zenner

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

Re: Can't connect to my database.

Could you pls guide me how to restore the rest of the files step by step ??
I've already messed enough and cant take anymore risk now..
what I need to upload now is :

  1. the EZ PAGES
  2. the Other COMMON PAGES (header,footer etc) and
  3. the modules (which i've altered according to my needs)

what are the files and folders that i would have to transfer so as to fulfill these requirements.

Thanx in advance.