Trek15 Posted October 1, 2009 Share Posted October 1, 2009 If anyone could help me with this i'd be mighty grateful: PHP version: 5.2.10 MySQL version: 5.0.81-community Unknown PHP error (2) mysql_connect() [function.mysql-connect]: Access denied for user 'myusername'@'localhost' (using password: YES) File: .../install.php Line: 584 if (empty($zcontext['e'])) { // test db info... $connection = @mysql_connect($processed['db_server'], $processed['db_user'], $processed['db_passwd']); if (!$connection || !@mysql_select_db($processed['db_name'], $connection)) { $zcontext['e'][] = $ztxt['install'][28]; // so the input fields are highlighted in red $zcontext['e'][$ekeys['db_server']] = ''; $zcontext['e'][$ekeys['db_user']] = ''; $zcontext['e'][$ekeys['db_passwd']] = ''; $zcontext['e'][$ekeys['db_name']] = ''; } Quote Link to comment https://forums.phpfreaks.com/topic/176125-unknown-php-error-2-mysql_connect-functionmysql-connect/ Share on other sites More sharing options...
.josh Posted October 1, 2009 Share Posted October 1, 2009 print_r($processed); does that print out expected info? Usually for localhost you just need 'localhost' not 'blah@localhost' Quote Link to comment https://forums.phpfreaks.com/topic/176125-unknown-php-error-2-mysql_connect-functionmysql-connect/#findComment-928055 Share on other sites More sharing options...
Trek15 Posted October 1, 2009 Author Share Posted October 1, 2009 I'm nowhere near as knowledgeable as anyone here. Could you perhaps tell me how to use print_r($processed); ? Quote Link to comment https://forums.phpfreaks.com/topic/176125-unknown-php-error-2-mysql_connect-functionmysql-connect/#findComment-928056 Share on other sites More sharing options...
.josh Posted October 1, 2009 Share Posted October 1, 2009 put it in your script just above $connection = @mysql_connect($processed['db_server'], $processed['db_user'], $processed['db_passwd']); and run it. You should see info about your $processed array output on the screen. Quote Link to comment https://forums.phpfreaks.com/topic/176125-unknown-php-error-2-mysql_connect-functionmysql-connect/#findComment-928058 Share on other sites More sharing options...
Trek15 Posted October 1, 2009 Author Share Posted October 1, 2009 Well that was easy, lol. The password was only three characters since it used the character "<" in it. I'll try it with a new password. Quote Link to comment https://forums.phpfreaks.com/topic/176125-unknown-php-error-2-mysql_connect-functionmysql-connect/#findComment-928059 Share on other sites More sharing options...
Trek15 Posted October 1, 2009 Author Share Posted October 1, 2009 Actually... i wonder something now. I have used this very same password with many other software-installations. Why do you think that the code in this software makes a break after the character '<' for the password? Quote Link to comment https://forums.phpfreaks.com/topic/176125-unknown-php-error-2-mysql_connect-functionmysql-connect/#findComment-928060 Share on other sites More sharing options...
.josh Posted October 1, 2009 Share Posted October 1, 2009 I have no idea what script you are using. You can tell me if you like, but I'm not going to go searching for it and then look over its code.. more than likely it simply doesn't accept non-alphanumeric chars in things like username, pw, etc... Quote Link to comment https://forums.phpfreaks.com/topic/176125-unknown-php-error-2-mysql_connect-functionmysql-connect/#findComment-928062 Share on other sites More sharing options...
Trek15 Posted October 1, 2009 Author Share Posted October 1, 2009 Well it's ok. I bumped into the error of not being allowed to access the site after creating and logging in as the admin anyways, so i can't use this stuff now. Thank for the help! Quote Link to comment https://forums.phpfreaks.com/topic/176125-unknown-php-error-2-mysql_connect-functionmysql-connect/#findComment-928067 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.