Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

database usage?


sheltonjb

Recommended Posts

Posted

hi folks,

 

i'm pretty new to ecommerce sites and databases and things, this is my first one. So this will probably sound like a stupid question, but here goes.

 

When i first installed osCommerce i messed up a few times until i got it right. i'm just wondering how many databases it needs? does it just run off the one? 'osc1' ?? because i'm unsure whether to delete the others or not.....

 

please let me know otherwise i'll probably delete something really important!

 

thanks alot

Shelton Brown

Web/Graphic Designer

Posted

Yeah, it only needs one. The one that is set in your two configure files:

 

includes/configure.php

admin/includes/configure.php

Posted
Yeah, it only needs one. The one that is set in your two configure files:

 

includes/configure.php

admin/includes/configure.php

 

thanks for your reply bud. I checked out the configure files and they have a mix of both '_osc1' and '_osc5' at various locations, so does that mean 2 databases are running? should they be like that? will it even run like that?

 

thanks for your help

Shelton Brown

Web/Graphic Designer

Posted

So in one configure file you have

 

define('DB_DATABASE', '_osc1');

 

and the other has

 

define('DB_DATABASE', '_osc5');

 

Not sure how you got to that but they both need to be the same. Just pick one and if all works ok, delete the others.

Posted
So in one configure file you have

 

define('DB_DATABASE', '_osc1');

 

and the other has

 

define('DB_DATABASE', '_osc5');

 

Not sure how you got to that but they both need to be the same. Just pick one and if all works ok, delete the others.

 

well in my 'my sql' section of my control panel i've got:

 

Users in osc1

_osc1 (Privileges: ALL PRIVILEGES)

 

Connection Strings

Perl $dbh = DBI->connect("DBI:mysql:_osc1:localhost","_osc1","<PASSWORD HERE>");

PHP $dbh=mysql_connect ("localhost", "_osc1", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());

mysql_select_db ("_osc1");

 

_osc5 (Privileges: ALL PRIVILEGES)

 

Connection Strings

Perl $dbh = DBI->connect("DBI:mysql:_osc1:localhost","_osc5","<PASSWORD HERE>");

PHP $dbh=mysql_connect ("localhost", "_osc5", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());

mysql_select_db ("_osc1");

 

so i'm guessing i can delete the '_osc5' one?

 

but actually within my configure files i have:

 

(includes/configure)

 

define('DB_DATABASE', '_osc1');

define('DB_TABLE_PREFIX', 'osc5_')

 

and another (admin/includes/configure)

 

define('DB_SERVER_USERNAME', '_osc5');

define('DB_SERVER_PASSWORD', '****');

define('DB_DATABASE', '_osc1');

 

as u can see there seems to be two mixed up with eachother, if i changed all the '_osc5' to '_osc1' do u think it'll mess up? or not affect it?

 

also i posted another question to do with databases, do u know anything about that.

 

thanks for your, much appreciated

Shelton Brown

Web/Graphic Designer

Posted

I'm not really sure how to advise you on this one. It looks like you are using 2 different milestones.

 

The define('DB_TABLE_PREFIX', 'osc5_') is used by MS3 but MS3 doesn't have an admin/includes/configure.php

 

Have you tried to upgrade?

Posted
I'm not really sure how to advise you on this one. It looks like you are using 2 different milestones.

 

The define('DB_TABLE_PREFIX', 'osc5_') is used by MS3 but MS3 doesn't have an admin/includes/configure.php

 

Have you tried to upgrade?

 

no i havent tried to upgrade, i dont have a clue whats going on i've messed it all up now the homepage doesnt even load after deleting that other '_osc5' user...i get this

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'shel0710_osc1'@'localhost' (using password: YES) in /home/shel0710/public_html/howlingcards/shoppingcart/includes/functions/database.php on line 19

Unable to connect to database server!

 

it's driving me nuts, i'm suppose to be opening up next week!

Shelton Brown

Web/Graphic Designer

Posted
no i havent tried to upgrade, i dont have a clue whats going on i've messed it all up now the homepage doesnt even load after deleting that other '_osc5' user...i get this

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'shel0710_osc1'@'localhost' (using password: YES) in /home/shel0710/public_html/howlingcards/shoppingcart/includes/functions/database.php on line 19

Unable to connect to database server!

 

it's driving me nuts, i'm suppose to be opening up next week!

 

There's a HUGE difference between having different users for one database or having completely different databases.

 

Based on what I've seen so far, it looks like you have one database named _osc1

 

Then you also have a user named _osc5, which is confusing but not impossible to work with.

 

The DB_TABLE_PREFIX reference to osc5_ seems to be a red herring, as for one thing "osc5_" and "_osc5" are two completely different terms, and another thing being that osCommerce 2.2 Milestone 2 doesn't use DB_TABLE_PREFIX (unless of course you have modified your store such that it does use it). Just to be safe, though, you should leave that line of code untouched unless you have a very good reason to change it (being unfamiliar with the usage of the code and/or confusing "osc5_" with "_osc5" is not a good reason).

 

Given that, it makes no sense whatsoever to delete the user _osc5, especially since it seems like your website was working just fine until you started monkeying around.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Posted
There's a HUGE difference between having different users for one database or having completely different databases.

 

Based on what I've seen so far, it looks like you have one database named _osc1

 

Then you also have a user named _osc5, which is confusing but not impossible to work with.

 

The DB_TABLE_PREFIX reference to osc5_ seems to be a red herring, as for one thing "osc5_" and "_osc5" are two completely different terms, and another thing being that osCommerce 2.2 Milestone 2 doesn't use DB_TABLE_PREFIX (unless of course you have modified your store such that it does use it). Just to be safe, though, you should leave that line of code untouched unless you have a very good reason to change it (being unfamiliar with the usage of the code and/or confusing "osc5_" with "_osc5" is not a good reason).

 

Given that, it makes no sense whatsoever to delete the user _osc5, especially since it seems like your website was working just fine until you started monkeying around.

 

Hi Dj,

 

Thanks for your upfront reply, i appreciate that. Problem is, yeah it was working fine but i was trying to include the 'discount coupons' contribution and someone suggested that it wasn't working because of the two different 'users'

 

It seems that's where the table prefix part came from, because my original error (in earlier posts) was about that coming up as an error within the 'order total' section of the admin section of cart...

 

do u think i should try and reverse everything? and then try and work with the coupon contribution another way?

Shelton Brown

Web/Graphic Designer

Posted
Hi Dj,

 

Thanks for your upfront reply, i appreciate that. Problem is, yeah it was working fine but i was trying to include the 'discount coupons' contribution and someone suggested that it wasn't working because of the two different 'users'

 

The problem you're having with Discount Coupon Codes, as I have posted, is that you didn't update the file admin/includes/database_tables.php.

 

It seems that's where the table prefix part came from, because my original error (in earlier posts) was about that coming up as an error within the 'order total' section of the admin section of cart...

 

do u think i should try and reverse everything? and then try and work with the coupon contribution another way?

 

You need to put your configure files back to the way they were when everything was working.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Posted
The problem you're having with Discount Coupon Codes, as I have posted, is that you didn't update the file admin/includes/database_tables.php.

You need to put your configure files back to the way they were when everything was working.

 

ledge!

 

works a treat, i reversed evrything, and uploaded the tables again and it all works. thanks for help dude. sorry you had to deal with a dummie! but we've all gotta learn at some point....

 

there's just one more issue, the new contribution has altered my date format - because i had switched it to english format, but i suppose i'll search and fine some info on that

Shelton Brown

Web/Graphic Designer

Posted
ledge!

 

works a treat, i reversed evrything, and uploaded the tables again and it all works. thanks for help dude. sorry you had to deal with a dummie! but we've all gotta learn at some point....

 

Oh, I know that... everything I learned, I learned the hard way....

 

there's just one more issue, the new contribution has altered my date format - because i had switched it to english format, but i suppose i'll search and fine some info on that

 

Date format where?

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Posted
Oh, I know that... everything I learned, I learned the hard way....

Date format where?

 

don't worry dude, i've found it and sorted it all.

 

thanks for all your help today, couldnt have got back on my feet without ya! :thumbsup:

Shelton Brown

Web/Graphic Designer

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...