Run a query from command line
# Use the -e flag
shell>mysql -e "select * from table"
Tell MySQL to output the results of a query in HTML or XML
# On command line you would write the following to
# tell MySQL to output the results in HTML format
shell>mysql -e "select * from table" --html
# This is for XML
shell> mysql -e "select * from table" --xml
# This is for batched results
shell> mysql -e "select * from table" --batch
Leave a Reply