Posted by: stephenmit | 30 May 2009

Accessing MySQL via command line

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.