Thursday, March 19, 2020

Executing mysql commands from unix command prompt

We can also run mysql queries from unix command prompt. This is useful in many cases, say i want to check status of db cluster or check running processes etc.

I am sharing a basic example here:


mysql -u username -p -e "show databases;"


The above command will ask for password and share output of current databases.


This is a quick way to get required information.

No comments:

Post a Comment