Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

install database error for admin section


Recommended Posts

Hello everyone, I am new to this board and I am also new to using the OSCommerce system. I am excited to get everything working, but I keep getting the following error when I try to connect to the Admin directory so that I can control ad administer my site. The error is copied and pasted below.

Thanks for any help anyone can give....







1046 - No Database Selected


select configuration_key as cfgKey, configuration_value as cfgValue from configuration







Link to comment
Share on other sites

  • 2 weeks later...

Hi There,


i'm a newbie to PHP/mySQL/Apache environments and am using a Mac OS X 10.3.9, mySQL version 4.0.25, Apache version 1.3.33 and PHP version 4.3.11


After many days perservering and learning much about the above, i am now getting the same error when trying to complete the installation by veiwing the Administration tool.


1046 - No Database Selected


i am confused as to why this is or what i can do to rectify the issue (i'm a novice as far as mysql / php goes so please, any advice that you may have can you give clear and concise instructions).


Firstly i thought it maybe because the admin folder was outside of the catalog directory in the root folder - but no. i have since moved the admin folder back into the catalog directory.


I have installed all the above locally so i know it's not a hosting issue. My aim is to do a fresh installation locally that mirrors a clients remote installation. (Slightly off tack, but if i want to replace the files on my local machine with copies from the clients remote installation, will the files replace the ones on my local machine and therefore mirror the remote installation????)


Some more information that maybe relevant (or not), on completion of the local installation when you get the options to view catalog or administration tool i also had these following warnings:_


New Installation


osCommerce Configuration


Warning: fopen(/Users/USERNAME/Sites/htdocs/catalog/admin/includes/configure.php): failed to open stream: No such file or directory in /Users/USERNAME/Sites/htdocs/catalog/install/templates/pages/install_7.php on line 259


Warning: fputs(): supplied argument is not a valid stream resource in /Users/USERNAME/Sites/htdocs/catalog/install/templates/pages/install_7.php on line 260


Warning: fclose(): supplied argument is not a valid stream resource in /Users/USERNAME/Sites/htdocs/catalog/install/templates/pages/install_7.php on line 261

The configuration was successful!


Any help or advice would be GREATLY appreciated - i feel i've been trying to get this thing working for so long now that my head is spinning and i'm beginning to feel queesy!


Cheers guys

Link to comment
Share on other sites



ok just searched the forum and got a fix from http://www.oscommerce.com/forums/index.php?sho...nistration+tool


Seems like you have to edit the appropriate PHP files. Copy the server information from catalog/includes/configure.php and paste that info into catalog/admin/includes/configure.php (use your favourite text editor) and hey presto!!! All works now.


Thanks to vger - without this forum i'd be bald and grey by now - oh wait, i already am!

Link to comment
Share on other sites

Damn me speaking too soon....


ok,well since i corrected the appropriate file i get the administration page - but when i try to view the links such as configuration, catalog, customers etc etc then i get


404 Not Found

The requested URL /admin/configuration.php was not found on this server. (or appropriate file according to the link on the admin page). All the files are located in the admin folder so i don't understand why i'm getting this error for all the links....


Please help me obi-wan.... i'm beginning to feel queesy!


"just when i thought i was out.... they pull me back in!"

Link to comment
Share on other sites

So, now i've had a lie down and rationalised my latest problem, it seems to be due to the installation instructions...


my admin page is installed at :- http://localhost/~USERNAME/htdocs/catalog/admin/


and i can now veiw this admin page. however all the subsequent links (this one is for the configuration page) to the admin directory are :- http://localhost/admin/configuration.php?s...fb1712c1e58c891


The installation instructions specify removing the admin directory from catalog and placing it in the root directory (in this case http://localhost/~USERNAME/htdocs/). however when placed in the root directory the installation screen cannot find the admin page. Therefore i moved the admin directory back into http://localhost/~USERNAME/htdocs/catalog/ and the admin page can now be found, Except every subsequent link points to http://localhost/admin/


If i place the admin directory anywhere on the localhost it cannot be found and i get the error 404 for any of the links.


Something tells me that the whole installation should be performed in the /usr/local/apache/htdocs/ folder - except i don't have an apache folder within my local directory (even though apache is installed and working) Can i simply create this directory (or any other) within my local folder? And will this affect the workings of apache?


i know this is a simple thing, and i'm making a schoolboy error at th moment, but my brain is so fried that i just can't see the wood for the trees here!!!


please, somebody, anybody... help!

Link to comment
Share on other sites

By far the simplest thing to do is to go with the default installaion - especially as you're working on a local install where security is not a big issue. e.g. http://localhost/catalog/admin


If you do that then settings for catalog/admin/includes/configure.php should look like this:


define('HTTP_SERVER', 'http://catalog');

define('HTTP_CATALOG_SERVER', 'http://catalog');


define('ENABLE_SSL_CATALOG', 'false');

define('DIR_FS_DOCUMENT_ROOT', 'c:/apachefriends/xampp/htdocs/catalog/'); // change to your own pathway

define('DIR_WS_ADMIN', '/catalog/admin/');

define('DIR_FS_ADMIN', 'c:/apachefriends/xampp/htdocs/catalog/admin/'); //Change to your own pathway

define('DIR_WS_CATALOG', '/catalog/');

define('DIR_FS_CATALOG', 'c:/apachefriends/xampp/htdocs/catalog/'); // Change to your own pathway



Link to comment
Share on other sites

Thanks for the advice vger.


I installed the catalog and admin folders into usr/local/ and also created a directory called htdocs and installed a copy there too, therefore i should have the choice to go through the installation via either:- http://localhost/catalog/install/ or:- http://localhost/htdocs/catalog/install/


trouble is when i try this i get another 404 file not found.


Obviously i'm a bit frustrated as the catalog that i installed previously in my sites folder works and it is only the admin folder that doesn't.


If i try the above then i cannot go through the installation procedure. i'm confused! confused as a baby rabbit....

Link to comment
Share on other sites

I installed the catalog and admin folders into usr/local/


That places it outside of the web root and so won't be accessible. The pathway to your web root is what you need to find out from your web hosting company, and that's where the 'catalog' folder goes.


There are a variety of pathways to the web root, so you really can only find out from your hosting company which one applies to your site.



Link to comment
Share on other sites

OK, i went for a fresh install and this is what i have learned (thanks to vgers top advice).


When you install on Mac OS X (assuming apache. mysql and php are all enabled)


Place the catalog folder in your sites folder i.e. /users/USERNAME/sites/ and leave the admin folder within the catalog folder. then you can install from http://localhost/USERNAME/catalog/install/ (make sure the user has administration priviledges)


Do not place the catalog folder inside the usr/local/ folder under the root user. Though this is the place where mysql and apache are located you cannot access http://localhost/catalog/install/


I'm a novice as far as all this goes and i know not why, but what i do know is installing from http://localhost/USERNAME/catalog/install/ works and you can access the admin panel without any issues at http://localhost/USERNAME/catalog/admin/


... now all i have to work out is how to apply a user to the .htaccess doc....


Question: Can i download all the files from a remote server (that mirror my local installation) and overwrite locally to provide a upto date version of the live site on my local machine? (theoretically it should work but are there any issues to be made aware of before i try this?)


once again, thanks vger your assitance on this forum is paramount!

Link to comment
Share on other sites

On a local install on your Mac you don't need to password protect the 'admin' folder - provided your computer has a good firewall - so no need for .htaccess for that.


Yes, you can download changed files from an online install, but the normal way of working is to change the files on your local install to check and see if they work and then upload them to the live website.


You can keep the databases synchronised by taking a backup of your online database, dropping all of the tables in the offline database and importing the online backup via the SQL tab in phpmyadmin.



Link to comment
Share on other sites


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

  • Create New...