Forums / General Questions / A dumb question, but I'm sort of confused about Mysql databases

A dumb question, but I'm sort of confused about Mysql databases

Locked

Started by jdog21 on 18 Sep 2010, 10:02 PM · Views: 1,181

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
18 Sep 2010, 10:02 PM
#1
jdog21 avatar

jdog21

New Zenner

Join Date:
Apr 2010
Location:
Tallahassee, Florida USA
Posts:
98
Plugin Contributions:
0

A dumb question, but I'm sort of confused about Mysql databases

My apologies, as this question is not about ZC per se, but it does absolutely involve my implementation of ZC, and I'm confused about this, so I need advice....

I am working on an e-commerce site. I made another ZC site, with it's own database, for testing purposes.

I wanted to see what would happen if I restored my project site's database to the test site's database.

It did what I thought, in that all the products, attributes, etc., are now on the test site. But the original site's password, etc., are also now on the test site, as well. I did not touch the test site's config. files. Additionally, references to the database refer only to the project site's database.

Should I could go in the test site's config. and change the database reference to it's original settings? All of the products, etc. would remain (I'm pretty sure).

If I leave it the way it is, will changes to the test site affect the project site's database?

It's possible, however unlikely, that I accidentally ftp'd the project site's config file(s) to the test site's directory. I often do stupid stuff like that. If I had to bet, though, I would bet that restoring the test site's database changed it's config files. Would I be correct?

I was to embarrassed to ask this stupid question on this forum, so I called GoDaddy's tech support. They have no idea what I'm talking about. Almost made me feel like I was advanced, or something......:cool:

18 Sep 2010, 10:56 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: A dumb question, but I'm sort of confused about Mysql databases

When you copy the database from your Live Site to your Test Site database ... the Admin logins will be the same as they are stored in the database ...

The database being used, however, would use the Test Site database name, username and password ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

18 Sep 2010, 11:02 PM
#3
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: A dumb question, but I'm sort of confused about Mysql databases

But the original site's password, etc., are also now on the test site

Do you mean the password you/humans enter to get into the Zen Cart admin area (this is stored in the database), or
the password the shop/admin software uses (stored in the configure.php files) to access the database ?

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

19 Sep 2010, 12:31 AM
#4
jdog21 avatar

jdog21

New Zenner

Join Date:
Apr 2010
Location:
Tallahassee, Florida USA
Posts:
98
Plugin Contributions:
0

Re: A dumb question, but I'm sort of confused about Mysql databases

As far as I know, the passwords for entrance into the admin area...

The database passwords, well I haven't seen yet. The database name referred to, though, is the original database.

19 Sep 2010, 12:38 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: A dumb question, but I'm sort of confused about Mysql databases

In your configure.php files, there are several DB_XXXXXXXX settings. The database, username, and password MUST be different in your test site's files, else you MIGHT accidentally be editing your live site when you're poking around in the test site's admin area.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Sep 2010, 1:22 AM
#6
jdog21 avatar

jdog21

New Zenner

Join Date:
Apr 2010
Location:
Tallahassee, Florida USA
Posts:
98
Plugin Contributions:
0

Re: A dumb question, but I'm sort of confused about Mysql databases

I thought that might be the case.

So in a situation where I restore my project database to a "blank" site (with the intent of making a copy) I would restore it with the database like I did, but would go into the new site's configure files and put their original database settings in there to ensure that they aren't referencing the original database....?

19 Sep 2010, 2:30 AM
#7
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: A dumb question, but I'm sort of confused about Mysql databases

I assume you are talking about your live database/shop and test database/shop living on the same server and so using the same mysql server.

The live shop database name is defined in the two live shop configure.phps,
the test shop database name is defined in the two test shop configure.phps,
evidently they should point to different databases or bad things will happen.

However once they are set up initially, you should not need to touch those files again, your database backup is imported directly into the corresponding test database (which includes the admin usernames and passwords).

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

19 Sep 2010, 10:48 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: A dumb question, but I'm sort of confused about Mysql databases

JDog21:

I thought that might be the case.

So in a situation where I restore my project database to a "blank" site (with the intent of making a copy) I would restore it with the database like I did, but would go into the new site's configure files and put their original database settings in there to ensure that they aren't referencing the original database....?
Basically, yes.
Akin to this: https://www.zen-cart.com/tutorials/index.php?article=100

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.