Bug #1127 password with backslash doesn't work
Submitted: 24 Aug 2003 10:10 Modified: 25 Aug 2003 6:16
Reporter: [ name withheld ] Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:3.23.55 OS:Other (OpenBSD 3.4 beta)
Assigned to: CPU Architecture:Any

[24 Aug 2003 10:10] [ name withheld ]
Description:
Using a password with a backslash in it does not seem to work.
The result is that the user can't log in. Replacing the backslash
with a different character makes the password work ok.

How to repeat:
grant any user some rights to a data base using a password with a backslash:

mysql> grant select on test.* to admin@localhost identified by 'abcd\3';
Query OK, 0 rows affected (0.02 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

Then the user admin can't log in:
$ mysql -p test
Enter password: 
ERROR 1045: Access denied for user: 'admin@localhost' (Using password: YES)

After changing the password to not include the backslash, it
works:
mysql> grant select on test.* to admin@localhost identified by 'abcd**3';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
$ mysql -p test
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 23 to server version: 3.23.55-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> Segmentation fault (core dumped)

Suggested fix:
Have better password handling routines including support for longer passwords (eg, more than 30 characters).
[25 Aug 2003 6:16] Alexander Keremidarski
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Backslash '\' is escape symbol for both mysql command line client and query parser.

Refer to manual about escaping backslashes.