0

Maybe I'm not seeing something here but WHY would this command line work perfectly fine and provide a result set when run on a LINUX command line but when executed from a WINDOWS command line it fails dismally and returns nothing?

mysql -hHOSTNAME -uroot -p --xml -e 'SELECT * FROM db.table' > c:\temp\output.xml

What am I missing here?

2 Answers 2

2

Windows command line does not recognize ' as a quote character, so your statement parameter becomes SELECT (truncated at the 1st space).

You must use " instead, as Heena Hussain suggested.

Sign up to request clarification or add additional context in comments.

1 Comment

Damn it! Thats the one, the double quote fixed it. Didnt even think that was the issue or to try double quotes. I suppose this is one of those issues of working by yourself, the lack of the extra eyes
2

Can you please try this...

C:\>mysql -u <userid> -p<password> -e "SHOW VARIABLES LIKE '%version%'" –-xml

and this...

mysql -u db_user -p db_name --xml -e "SELECT * FROM table_name" > table_name.xml

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.