The need to run MySQL queries on the Linux command line comes up from time to time. I will briefly outline how to do so here.
Login to the server via SSH and type:
mysql -u username -p
Adding the option of -A at the end of this will also speed things up when selecting a database. I found with a large quantity of tables I was not able to wait long enough for them to load, and as a result I was not able to use the mysql command line interface.
Once this is done, the password prompt comes up, and on successful entering of the password, you can type away into mysql as you please.
Advertisement