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:

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

About this Entry

This page contains a single entry by Robert Wray published on January 20, 2009 9:54 AM.

hotfrog.co.uk: II was the previous entry in this blog.

Disband the Portman Group is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 5.04