FAM0422 Posted June 23, 2011 Share Posted June 23, 2011 Hi i have set up a php website via dreamweaver with a testing host as local Everything works fine local i can test it all the tables of the database appear correctly on my testing server Once i upload this i keep getting this error Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'DANI'@'localhost' (using password: YES) in /home/u466564495/public_html/Connections/MANI.php on line 9 Fatal error: Access denied for user 'DANI'@'localhost' (using password: YES) in /home/u466564495/public_html/Connections/MANI.php on line 9 I have try many things crated different user check password user names I try other host, different servers wamp xampp easy php but i still get the same error i dont have a clue why This is my code <?php # Type="MYSQL" # HTTP="true" $hostname_localhost = "localhost"; $database_localhost = "cdcol"; $username_localhost = "root"; $password_localhost = "password"; $localhost = mysql_pconnect($hostname_localhost, $username_root, $password_password) or trigger_error(mysql_error(),E_USER_ERROR); ?> i thin used easy php as a testing server and change this to <?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_YYY = "127.0.0.1"; $database_YYY = "information_schema"; $username_YYY = "FAM0422"; $password_YYY = "your_password"; $YYY = mysql_pconnect($hostname_127.0.0.1, $username_FAM0422, $password_your_password) or trigger_error(mysql_error(),E_USER_ERROR); ?> i am using windows 7 with dreamweaver8 it works fine local just not on remote host. i greatly appreciate any ideas and help as i been stuck on this for 4 days lol Please Help Quote Link to comment https://forums.phpfreaks.com/topic/240195-php-mysql-error-fatal-error-access-denied-for-user-rootlocalhost/ Share on other sites More sharing options...
AMcHarg Posted June 23, 2011 Share Posted June 23, 2011 What's going on with the variables? Try: <?php # Type="MYSQL" # HTTP="true" $hostname_localhost = "localhost"; $database_localhost = "cdcol"; $username_localhost = "root"; $password_localhost = "password"; $localhost = mysql_pconnect($hostname_localhost, $username_localhost, $password_localhost) or trigger_error(mysql_error(),E_USER_ERROR); ?> Quote Link to comment https://forums.phpfreaks.com/topic/240195-php-mysql-error-fatal-error-access-denied-for-user-rootlocalhost/#findComment-1233791 Share on other sites More sharing options...
FAM0422 Posted June 23, 2011 Author Share Posted June 23, 2011 Hi, Thanks for your reply i have already try that and i got the same error, that was my original code i then made changes to it which are show in my 1st post. All three codes gv same error, i dont thnk it is error with the code maybe it is mysql? <?php # Type="MYSQL" # HTTP="true" $hostname_localhost = "localhost"; $database_localhost = "cdcol"; $username_localhost = "root"; $password_localhost = "password"; $localhost = mysql_pconnect($hostname_localhost, $username_localhost, $password_localhost) or trigger_error(mysql_error(),E_USER_ERROR); ?> Quote Link to comment https://forums.phpfreaks.com/topic/240195-php-mysql-error-fatal-error-access-denied-for-user-rootlocalhost/#findComment-1233808 Share on other sites More sharing options...
mikosiko Posted June 23, 2011 Share Posted June 23, 2011 suggestions: - Check that the user that you have in the DB is DANI and not dani (... according to the errors shown that is the user (and no root) that you are using to login). - Check that the user has the proper GRANTS for the DB/tables. Quote Link to comment https://forums.phpfreaks.com/topic/240195-php-mysql-error-fatal-error-access-denied-for-user-rootlocalhost/#findComment-1233814 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.