1.要求,自动登录mysql(root:root,passwd:123456),查询test库,test1表里的user=aa的记录.
#!/bin/sh
mysql -uroot -p123456 <use test;
select * from testaa while a=10000; ###1000 not usr single quote mark,because a is int type,only char type need single quote mark.
EOF
2.拿oracle举个例子:
su - oracle -c sqlplus <sys/sys as sysdba
spool /res.lst
selec * from test;
spool off
exit
!
阅读(3822) | 评论(0) | 转发(0) |