Bug #15761 mysql fails to pick up some escaped values properly from config file
Submitted: 14 Dec 2005 22:26 Modified: 4 Aug 2006 12:40
Reporter: Tobias Asplund Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0.16\BK 5.0 OS:Windows (Windows\Linux)
Assigned to: Alexey Botchkov CPU Architecture:Any

[14 Dec 2005 22:26] Tobias Asplund
Description:
(Only tested on windows)

How to repeat:
C:\>cat my.ini
[client]

[mysql]
prompt = \s>\_

C:\>mysql
Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8 to server version: 5.0.16-nt

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

 >

Suggested fix:
It works with double-escaping.

C:\>cat my.ini
[client]

[mysql]
prompt = \\s>\\_

C:\>mysql
Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9 to server version: 5.0.16-nt

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

25>
[4 Aug 2006 12:40] Alexey Botchkov
Manual states:
_______________________
Use an option file. You can set the prompt option in the [mysql] group of any MySQL option file, such as /etc/my.cnf or the .my.cnf file in your home directory. For example: 

[mysql]
prompt=(\\u@\\h) [\\d]>\\_

In this example, note that the backslashes are doubled
________________________

So looks like expected behaviour.