MySQL

Running a MySQL Command from CLI

So you want to run a select statement from the command line – use the -e switch

mysql -u username -p password -h hostname -e "SQL Statement" database

Leave a Reply