Linux命令行与shell脚本(18)--shell连接mysql
在脚本中使用数据库连接数据库并查询表#!/bin/bashmysql=`which mysql`;$mysql shell -u root -proot -e "select * from employees" #连接shell数据库,-e后指定执行的语句执行多条命令mysql=`which mysql`;$mysql shell -u root -proot <<EOF #shell