How much time do you spend every week typing in ‘mysqladmin -u root -p showprocesslist’ ? or ‘mysqladmin -u root -p kill 123,456,789 ? After listening to Tom Limoncelli‘s video presentation of a workshop called “Time Management for System Administrators” (which was the forerunner to the O’Reilly book of the same name), I realized that I could implement some of his tips right away.
Specifically, aliasing. I’ve now aliased the following in my .bash_profile:
alias myps=’mysqladmin -u root -p processlist’
alias mystatus=’mysql -u root -p -e “show status; status;”‘
alias mykill=’mysqladmin -u root -p kill’
alias mysqlr=’mysql -u root -p’
I’d rather not put passwords into my profile, and this makes for easy copying. I use CVS instead of copying to track and easily update changes to my .bash_profile. But I realized while watching the recording that there are many commands, particularly relating to mysql, where I end up typing a lot for the same command over and over.