New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't log in with MySQL username containing "á" #12232

Closed
ibennetch opened this Issue May 5, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@ibennetch
Member

ibennetch commented May 5, 2016

Steps to reproduce

  1. Create a user containing the á character (mine is simply called á without any other characters)
  2. Log out and attempt to log in as that user

Expected behaviour

I should be logged in successfully

Actual behaviour

I am shown the error message

mysqli_real_connect(): (28000/1045): Access denied for user 'á'@'localhost' (using password: YES)

Server configuration

Operating system:
Debian Linux
Web server:
Apache 2.4.10
Database:
MySQL 5.5.49
PHP version:
5.6.20
phpMyAdmin version:
4.7.0-dev; git revision 5a4af02
Client library
libmysql - 5.5.49

Client configuration

Browser:
Firefox 46.0.2
Operating system:
Mac OS X

@ibennetch

This comment has been minimized.

Member

ibennetch commented May 5, 2016

By the way, mysql -u á -p works correctly.

@nijel nijel added the bug label May 11, 2016

@nijel nijel added this to the 4.6.2 milestone May 23, 2016

@nijel nijel self-assigned this May 23, 2016

@nijel nijel removed this from the 4.6.2 milestone May 23, 2016

@nijel

This comment has been minimized.

Member

nijel commented May 23, 2016

This is caused by client charset being set to something else that utf-8. The problem is that there is no way in PHP to set charset before authenticating. So PHP is sending utf-8 encoded string, while MySQL parses it as iso-8859-1 (what is usually the default).

Also see http://php.net/manual/en/mysqli.real-connect.php#refsect1-mysqli.real-connect-notes

So I think the only way to allow authentication with non ascii usernames (or passwords) is to change server default charset to utf-8.

@ibennetch

This comment has been minimized.

Member

ibennetch commented May 28, 2016

Thanks for figuring that out.

So this is really a MySQL configuration issue and there's nothing we can do about it. But I wonder why the command line client works, then.

I'm not even sure that this is worth adding a FAQ entry about at this point. What do you think?

@nijel

This comment has been minimized.

Member

nijel commented May 30, 2016

I'm not sure either. I assume you have found this while solving question of some user, right?

@ibennetch

This comment has been minimized.

Member

ibennetch commented May 30, 2016

Correct, although I believe discovering this was a side-effect of their actual problem, rather than the problem itself.

If there's nothing to be done in the code, I think it's best to write a FAQ about it and move on.

@ibennetch ibennetch assigned ibennetch and unassigned nijel May 30, 2016

@ibennetch

This comment has been minimized.

Member

ibennetch commented May 30, 2016

Do you mind reviewing #12284 for accuracy?

@nijel nijel added this to the 4.7.0 milestone Jun 3, 2016

@nijel nijel closed this in c993509 Jun 3, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment