shell脚本中执行sql命令

1、mysql 数据库表信息

2、shell脚本(a.sh)信息

#!/bin/sh
mysql -u root << myInsert
    insert into test.t values("LXH",100);
myInsert

3、执行

     ./a.sh

4、 执行结果

posted @ 2018-07-08 15:06  lvlin241  阅读(9250)  评论(0编辑  收藏  举报