Bug #38684 mysql_secure_install fails when using "\" in the root password
Submitted: 8 Aug 2008 23:11 Modified: 9 Aug 2008 17:30
Reporter: Daniel Bathgate Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0.60, 4.1, 5.0, 5.1, 6.0 bzr OS:Any
Assigned to: CPU Architecture:Any

[8 Aug 2008 23:11] Daniel Bathgate
The mysql_secure_install tool appears to treat the "\" character as an escape rather than a character when entering the root password. Backslashes in the middle of a password are ignored, while one backslash at the end escapes the return and cannot be typed in other command line tools. Two backslashes at the end cause the following error:

ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'root'' at line 1

How to repeat:
Run mysql_secure_install. When prompted to change the root password, accept, and enter a password with a backslash.
[9 Aug 2008 17:30] Sveta Smirnova
Thank you for the report.

Verified as described.
[20 Aug 2008 23:14] Jim Winstead
There are two possible problem areas here -- the query issued when setting a new password, and the creation of the configuration file used when issuing other commands. Setting a new password will also choke on an ' in the password, and it wouldn't surprise me if the configuration file showed problems with '#' in passwords.