shell自动连接mysql后进行查询操作的方法
时间:2006-09-12 来源:huanghaojie
1.要求,自动登录mysql(root:root,passwd:123456),查询test库,test1表里的user=aa的记录.
#!/bin/sh
mysql -uroot -p123456 <<EOF
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
#!/bin/sh
mysql -uroot -p123456 <<EOF
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
相关阅读 更多 +