Description:
Using the --defaults-file option on mysql.exe to connect to a server, and passing within the path Unicode characters causes a fatal error
How to repeat:
Make sure you have a config file in a folder containing Unicode characters.
Running something like:
"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" --defaults-file="C:\Users\Javier Treviño\MySQL\mysql-sandboxes\3310\my.cnf" "-uroot" "-p"
will throw the following:
mysql: [ERROR] Could not open required defaults file: C:\Users\Javier Trevi├▒o\MySQL\mysql-sandboxes\3310\my.cnf
mysql: [ERROR] Fatal error in defaults handling. Program aborted!
In this case the "ñ" character is being read wrongly by the mysql.exe
Suggested fix:
A workaround (maybe not suitable for everyone) is using DOS naming convention.
For me using the following works:
C:\Users\Javier Treviño>"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" --defaults-file="C:\Users\Javier~1\MySQL\mysql-sandboxes\3310\my.cnf" "-uroot" "-p"
But the real fix is checking why Unicode characters are not interpreted correctly.