Still working my way around this, but is there any function/command I can use to set some simple variables?
Logging into mysql is quicker when I’m already ssh’d in, but typing in the full connection string is a bit annoying.
Any way to do something like:
mysql ${variable} dbname
Where variable would be something like -u user -p -h hostname
Or, is there another way to do what I need?
Create alias in your
~/.bash_profile(on the server). Changes in~/.bash_profilewill have effect the next time you log in.For example add
And then use it via
or when already logged on, just:
From the bash manpage: