一、MySQL数据库:
mysql --defaults-file=.my.cnf --connect_timeout=5 -N --batch -e "show full processlist"
[client] host=‘‘ user=‘‘ password=‘‘
二、Oracle数据库
三、SQLServer数据库
四、PostgreSQl数据库
Shell命令行执行SQL语句
原文:http://blog.51cto.com/395469372/2062507