What possible reasons could exist for MySQL giving the error “Access denied for user 'xxx'@'yyy'”
when trying to access a database using PHP-mysqli and working fine when using the command-line mysql tool with exactly the same username, password, socket, database and host?
Update:
There were indeed three users in the mysql.user
table, each one with a different host (but with the same hashed password), one was set to localhost, one to 127.0.0.1 and one to the machine’s host name. Deleting two of them and changing the host of the third to “%” had only one effect: now the access is denied using the command-line tool also.
I did do a
select user();
before that in the command line and it yielded the same xxx@yyy that were denied in php.