On my local WAMP stack things are working perfectly.

When I upload the database on GOdaddy.com, this error shows up.

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)

What does it mean?

  • @MdHaidarAliKhan i am using GODADDY server. on my local host working perfect but i upload on GODADDY database..then show error. – user69104 Jun 23 '15 at 7:55
  • where do you get this error? In your application or you trying to access in from you machine? this error usually shows up when ur password is wrong – Masoud Jun 23 '15 at 8:20
  • @Masoud on my local host(WAMP) working perfectly. but on GODADDY when i upload DB from there they show error access denied. two days not find solution . – user69104 Jun 23 '15 at 8:23
  • 1
    @MdHaidarAliKhani find the solution. solution is change the host name . my localhost is 50.62.300.6 and i use there localshost. thats why show error . – user69104 Jun 24 '15 at 9:23

You are getting this error because the root account on your local machine doesn't have a password. That's why you can login locally with using password: NO

Probably your server on godaddy has a password set, or the root account disabled. You need to fix the credentials in your application (and probably use a login other than root)

  • if i add the password on my local machine then work on godaddy server ?? – user69104 Jun 23 '15 at 9:42
  • We don't have nearly enough information to answer that. Most probably it won't work on your server either. You need to add the right login information in your application depending on the server you are on. – Tom V Jun 23 '15 at 9:59
  • now i find the solution now i need to set up godaddy phpmyadmin. – user69104 Jun 23 '15 at 10:42
  • tom i find the solution . solution is simple just change my localhost ..local host is mine 50.62.300.9 . i change to this one and script working. – user69104 Jun 24 '15 at 9:22

MAMP seems to handle the root username differently than WAMP. I had to include the root password as 'root' in my PHP script, instead of leaving it blank, as such:

$link = mysqli_connect('localhost', 'root', 'root');

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.