mysql command line query command


Well-known member
So I want to execute queries through mysql command line on putty.

I can't seem to find a command to do that exactly. If anyone knows, please post it below.

Jake Bunce

XenForo moderator
Staff member
Login to MySQL and select your database:


Type queries into the mysql prompt. Note that you must end queries with a semicolon when using the mysql prompt. The enter key will merely insert a line break into the query which isn't functional. It won't execute the query until you type a semicolon and then hit enter.


Well-known member
I would skip the password, is very easy for an attacker to intercept your text data while you send it from a terminal.


Well-known member
The way I do it is:
mysql -u root -p

From there, I select whatever options I'm interested to deal with.