MattReid Posted January 20, 2010 Share Posted January 20, 2010 Hello! I installed last night and had a quick look around the Admin pages, fine. Today I assumed I just had to go to www.mysite.com/catalog/admin to log in, but when I do I get this: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'mysql'@'localhost' (using password: NO) in /home/www/mjrcreat/catalogue/admin/includes/functions/database.php on line 19 Unable to connect to database server! What am I doing wrong? Being an idiot probably. Thanks! Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted January 20, 2010 Share Posted January 20, 2010 Did your front end connect properly? If so then just compare your database settings in /catalog/includes/configure.php with the settings in /catalog/admin/includes/configure.php If neither side connects are you sure you have the settings in the two configure.php files as your host supplied to connect to your mysql server? And while you are fixing that, take a close look at the thread title "Securing your site" and apply all the security patches so that you are not victimized. They seem to be able to find new stores quickly and hack them with malicious code. Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...? Link to comment Share on other sites More sharing options...
MattReid Posted January 20, 2010 Author Share Posted January 20, 2010 Hi, thanks for replying. Yes, I was going to get on with all the security stuff when I found this error! Both front end and admin connected last night, but I only went to admin through the final page of the install. Front end connects fine. This is catalogue/includes/configure.php <?php/* $Id: configure.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ // Define the webserver and path parameters // * DIR_FS_* = Filesystem directories (local/physical) // * DIR_WS_* = Webserver directories (virtual/URL) define('HTTP_SERVER', ''); // eg, http://localhost - should not be empty for productive servers define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers define('ENABLE_SSL', false); // secure webserver for checkout procedure? define('HTTP_COOKIE_DOMAIN', ''); define('HTTPS_COOKIE_DOMAIN', ''); define('HTTP_COOKIE_PATH', ''); define('HTTPS_COOKIE_PATH', ''); define('DIR_WS_HTTP_CATALOG', ''); define('DIR_WS_HTTPS_CATALOG', ''); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/'); define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); // define our database connection define('DB_SERVER', ''); // eg, localhost - should not be empty for productive servers define('DB_SERVER_USERNAME', ''); define('DB_SERVER_PASSWORD', ''); define('DB_DATABASE', 'osCommerce'); define('USE_PCONNECT', 'false'); // use persistent connections? define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql' ?> And this is catalogue/admin/includes/configure.php <?php/* $Id: configure.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2002 osCommerce Released under the GNU General Public License */ // define our webserver variables // FS = Filesystem (physical) // WS = Webserver (virtual) define('HTTP_SERVER', ''); // eg, http://localhost or - https://localhost should not be NULL for productive servers define('HTTP_CATALOG_SERVER', ''); define('HTTPS_CATALOG_SERVER', ''); define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs) define('DIR_WS_ADMIN', '/admin/'); define('DIR_FS_ADMIN', DIR_FS_DOCUMENT_ROOT . DIR_WS_ADMIN); define('DIR_WS_CATALOG', '/catalogue/'); define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/'); define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/'); define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/'); define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/'); define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/'); // define our database connection define('DB_SERVER', ''); define('DB_SERVER_USERNAME', 'mysql'); define('DB_SERVER_PASSWORD', ''); define('DB_DATABASE', 'osCommerce'); define('USE_PCONNECT', 'false'); define('STORE_SESSIONS', ''); ?> Perhaps it doesn't help that I've spleed my folder "catalogue"? As you can see I've changed it in the admin configure... Link to comment Share on other sites More sharing options...
MattReid Posted January 20, 2010 Author Share Posted January 20, 2010 ^ (Of course I meant to say "spelled" not "spleed" above.) (Why can't I edit my own posts?) Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted January 20, 2010 Share Posted January 20, 2010 Have you installed this on your local machine? You have no http or https server paths. these will be necessary for a live shop. Look at the bottom of each where is says //Define Database Connection. They are not the same. In a production environment you don't want them to be, but for now to troubleshoot the connection they probably should be. You are not using a username in the store side, but are using one on the admin side. Which works again? Change the other to match the one that works. And if you changed something in the admin/configure.php maybe that is why it does not work. have you tried changing it back (if that is what you did?) Of course, you really do want to use a username and password once this is accessible from the internet. You may not be able to edit your own posts if you have javascript disabled in your browser. Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...? Link to comment Share on other sites More sharing options...
MattReid Posted January 20, 2010 Author Share Posted January 20, 2010 Ok right, I am every bit the idiot I said I was. :blush: I just started using a new FTP program and the local and remote panes are the opposite way round from my old one. Thanks for the helps peeps, I shall start again and no doubt be back with some further stupidity later. Bet you can't wait. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.