MySql - Error: Unknown command '\b'
For some reason, some paths (there doesn't appear to be a determining factor as to what they are) when passed to the MySql.exe process cause an error message similar to:
mysql.exe -uUSERNAME -pPASSWORD -hHOST_IP_ADDRESS DATABASE_NAME_HERE -e "source c:\buildserver\source\Databases\DatabaseName\src\sql\schema\tables\tableName.sql
Generates the message '\b', if the c:\buildserver folder is renamed to aardvark, the message "ERROR: Unknown command '\a'" is returned.
The Solution
The solution appears to be to replace all the "\" with "/" in the path that you're passing in. Yeup, that simple. So, say you have a property called "filename" in a nant script, you could pre-process it with:
<property name="target" value="${string::replace(filename, '\', '/')}"/>
Which should give you a filename that MySql can stomach
ERROR: Unknown command '\b'Unfortunately, it doesn't seem to be limited to this specific '\b' - as that seems to be whatever is immediately after the "C:" in the path to the sql file to process, so:
mysql.exe -uUSERNAME -pPASSWORD -hHOST_IP_ADDRESS DATABASE_NAME_HERE -e "source c:\buildserver\source\Databases\DatabaseName\src\sql\schema\tables\tableName.sql
Generates the message '\b', if the c:\buildserver folder is renamed to aardvark, the message "ERROR: Unknown command '\a'" is returned.
The Solution
The solution appears to be to replace all the "\" with "/" in the path that you're passing in. Yeup, that simple. So, say you have a property called "filename" in a nant script, you could pre-process it with:
<property name="target" value="${string::replace(filename, '\', '/')}"/>
Which should give you a filename that MySql can stomach
