bosskax Posted February 6, 2007 Share Posted February 6, 2007 We've got a test server where we view staging pages before they go live. When I view them in the test I get the following error message: Warning: mysql_connect(): Access denied for user 'mn_webadmin'@'mnsv-henreid.campus.bath.ac.uk' (using password: YES) in D:\www\htdocs\management\_classes\incutioDatabase.class.php on line 55 Fatal error: There seems to be a problem with the database. in D:\www\htdocs\management\_classes\incutioDatabase.class.php on line 61 i've checked the incutioDatabase.class.php on both lines 55 and 61 and there doesnt seem to be anything weird but then again am not that familiar with php can anyone help me thanks Link to comment https://forums.phpfreaks.com/topic/37323-access-denied/ Share on other sites More sharing options...
Balmung-San Posted February 6, 2007 Share Posted February 6, 2007 The first seems to be an issue with your database connection. It seems like the user "mn_webadmin" does not have access, or the password is invalid. Link to comment https://forums.phpfreaks.com/topic/37323-access-denied/#findComment-178404 Share on other sites More sharing options...
bosskax Posted February 7, 2007 Author Share Posted February 7, 2007 do you have a solution? heres the cfg.php file..this may or may ot help /* This is where you setup the system */ // The path to the root of the app. $root = $_SERVER['DOCUMENT_ROOT'].'/management'; // ignore these two lines require($root.'/_classes/config.class.php'); $config = new CMSLiteConfig($root); // The base of the URLs. So if the system is in a directory called 'cms', this // wants to be '/cms/' // If the system is on the root, leave it as '/' $config->setUrlBase('/management/'); // this is some unique string for the database to identify the site $config->setSiteName('management'); // setup the database details $config->setDbUser('mn_webadmin'); $config->setDbPassword('********'); //$config->setDbHost('mysqlhost'); //$config->setDbHost('mnsv-henreid.campus.bath.ac.uk'); $config->setDbHost('mysqlhost.bath.ac.uk'); // WHEN FILE IS UPLOADED THIS WILL NEED TO BE SET TO mysqlhost.bath.ac.uk $config->setDbDatabase('mnWebPages'); /* Advanced - Ignore from here unless you know what you are doing */ // setup the templates $config->setDefaultTemplate('page'); $config->addTemplate('./index.html', 'frontpage'); // caching - disable by setting to false - useful for debugging but should be set to true when live $config->setCaching(false); // switch it off to make the system display pages changed in LDAP, // upload, then switch it back on and upload again // OR EVEN BETTER logon to the database and execute: // truncate table pages; // HTMLTidy - disable by setting to false - useful for debugging but should be set to true when live $config->setTidy(true); // dynamic content. Setup special cases here //$config->setSpecialCase('./expertise/directory', 'expertise_directory'); $config->setSpecialCase('./about/people', 'people_directory'); $_SERVER['config'] = $config; Link to comment https://forums.phpfreaks.com/topic/37323-access-denied/#findComment-178984 Share on other sites More sharing options...
bosskax Posted February 7, 2007 Author Share Posted February 7, 2007 any guesses people? ??? :-\ Link to comment https://forums.phpfreaks.com/topic/37323-access-denied/#findComment-179171 Share on other sites More sharing options...
Balmung-San Posted February 7, 2007 Share Posted February 7, 2007 1. You just gave us your password. 2. Do you have a client you can use to connect to the database with that prompts for username and password? If so, use that username/password combination there. 3. Make sure that user has privileges on that database. Link to comment https://forums.phpfreaks.com/topic/37323-access-denied/#findComment-179178 Share on other sites More sharing options...
Hypnos Posted February 7, 2007 Share Posted February 7, 2007 It has nothing to do with PHP. The MySQL server is rejecting your username and password. Link to comment https://forums.phpfreaks.com/topic/37323-access-denied/#findComment-179215 Share on other sites More sharing options...
sayedsohail Posted February 7, 2007 Share Posted February 7, 2007 I would suggest you to just create separate php file and test the connection and print the error. I agree with the above comment, it has more to do with your database connectivity issue. Link to comment https://forums.phpfreaks.com/topic/37323-access-denied/#findComment-179244 Share on other sites More sharing options...
bosskax Posted February 9, 2007 Author Share Posted February 9, 2007 created a new php file and its still reacting the same way Link to comment https://forums.phpfreaks.com/topic/37323-access-denied/#findComment-180561 Share on other sites More sharing options...
sayedsohail Posted February 9, 2007 Share Posted February 9, 2007 $dbhost = "localhost"; $dbuser = "name"; $dbpass = "password"; $dbname = "bathdata"; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error Connecting to mysql'); mysql_select_db($dbname); $query = "SELECT * FROM table"; $result = mysql_query($query) or die(mysql_error()); $numrows = mysql_num_rows($result); if ($numrows == 1) {$row = mysql_fetch_assoc($result);} echo "$row[fieldname]"; see if returns any rows Link to comment https://forums.phpfreaks.com/topic/37323-access-denied/#findComment-180642 Share on other sites More sharing options...
bosskax Posted February 12, 2007 Author Share Posted February 12, 2007 cheers guys I know I must sound daft but do i just create a php file and then test on the staging area and see what happens? or do I paste this into the original php file? Link to comment https://forums.phpfreaks.com/topic/37323-access-denied/#findComment-182596 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.