I am using MySQL with PHP for printing details from a database. I tried to make a new user, which was successful, although I get an error from MySQL when I tried to fetch data from it. It showed me this error:

       ( ! ) Warning: mysqli::mysqli(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO) in D:\wamp\www\index_feed\index_feed.php on line 8
Call Stack
#   Time    Memory  Function    Location
1   0.0010  238200  {main}( )   ..\index.php:0
2   0.0024  289384  require_once( 'D:\wamp\www\index_feed\index_feed.php' ) ..\index.php:48
3   0.0024  289672  feed_print( )   ..\index_feed.php:136
4   0.0024  291264  mysqli ( )  ..\index_feed.php:8

The dilemma here is that I am not even using a root user and, yes, I do have a password for root, but in the error it is showing using password : NO. I am totally stuck here, I think it's a problem with using password.

I have tried using the root user for fetching data, but it still doesn't work. The same error showed up.

  • 2
    The trouble is in the mysqli_connect() call. – Rick James May 17 '15 at 0:10
  • are you writing the password while making database connection? – Nivedita May 18 '15 at 16:47
  • If you not mentioned the user name, by default, it consider as root user. I faced similar issue - I fixed it by adding the username and password in the connection parameters available in the configuration file of WAMP. For Access Denied issue - refer this page - rathishkumar.in/2017/04/… – Rathish May 7 '17 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.