I have created a web & found below error. Please help where I am doing mistake?? "Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'atifh_ef'@'localhost' (using password: YES) in /home/atifh/public_html/admin/setting.php on line 198 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/atifh/public_html/admin/setting.php on line 199 Access denied for user 'atifh_ef'@'localhost' (using password: YES)" "Setting.php" file attached for your reference
It's like the error message says. You are trying to connect to a MySQL database using invalid user information. You should create a new user and give him access to the database you are going to be using. Then you need to update your PHP code so that it uses the info for that user, rather then the old one. Also, keep in mind that using the root user in a PHP script is a HUGE security risk. You should always create a limited user to use in your websites.
Thanks I have tried many times by changes new MySql user+DB but same error. Anways look at lines 198 & 199 of script.
It is your mySQL user credentials issue; follow steps and let me know if you got any question or concern; Verify if your username and passwords are working; Try passing following command in your mySQL client (could be command prompt, SQLYog and a like) mysql --user atifh_ef --password atif -h localhost atifh_ef Code (markup): and observe what it returns If your username is not created then create one as follows; grant all on atifh_ef.* to atifh_ef@localhost IDENTIFIED BY 'atif' [*]Instead of [code]$db_connect = mysql_connect($db_host, $db_username, $db_password); Code (markup): write following $db_connect = mysql_connect($db_host, $db_username, $db_password) or die ("Database Connection Error: " .mysql_error()); Code (markup): Best!