User login

MySQL user at any host doesn't work, needs localhost in some local personal computer development environments

Where the user, password, and database are all "xmp".

ben@blackbox:/var/www/xmp$ mysql -u xmp -pxmp xmp < IMPORT_THIS_TO_YOUR_XMP_DB.sql

ERROR 1045 (28000): Access denied for user 'xmp'@'localhost' (using password: YES)

i can't even get that to work

Solution: it was the weird thing where telling it to allow the connection from % (any host) doesn't work when you use localhost

i think I had the problem on XAMPP, and Alan had it on Bitnami or whatever, and now on our Ubuntu box. Very very weird

i changed it in phpmyadmin -- replaced the % with localhost and said delete the old account and reload all privileges

ben@blackbox:/var/www/xmp$ mysql -u xmp -pxmp xmp < IMPORT_THIS_TO_YOUR_XMP_DB.sql

same command worked now

Resolution

Comments

strange, but documented

I had this exact same problem. It turns out that the default Any@'localhost' is overriding your 'xmp'@'%'. You can delete your Any users or be more specific about the domain of the user.

It's very counter-intuitive, but it is documented (here):

One account ('monty'@'localhost') can be used only when connecting from the local host. The other ('monty'@'%') can be used to connect from any other host. Note that it is necessary to have both accounts for monty to be able to connect from anywhere as monty. Without the localhost account, the anonymous-user account for localhost that is created by mysql_install_db would take precedence when monty connects from the local host. As a result, monty would be treated as an anonymous user. The reason for this is that the anonymous-user account has a more specific Host column value than the 'monty'@'%' account and thus comes earlier in the user table sort order

Thanks!

Another mystery explained...

Thanks!

Hello, thanks for the info

It just worked like charm!!!

^____________^

Additional info to next readers:
This solves slow xammp/wammp connections. I don't know why but when I use this solution, it just worked and everything went well!

Thanks!

  1. God is Good! and I can prove that

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.