Helge's blog

14 February, 2014
by Helge
0 comments

Mysql SQL in bash one-liner

If you just need a quick way to get some data from a mysql database in your shell (bash), you could do something like this in one line: mysql -h your.server.edu -u db_username -p`cat /path/to/your/homedir/secretpasswordfile` -e “;use databasename; SELECT tablename.columnname … Continue reading