在shell脚本中如果使用 mysql -uroot -paaaa 登陆后 会自动执行脚本中下一条sql语句吗? 另外有什么办法在shell脚本中不泄露密码吗?
初学shell,请多指教,谢谢 想法是这样的 CNT=0 USER_TOT=0 while [ "$CNT" -le "30" ] do TABLE_PREFIX="USER_01" USER_COUNT=0 sqlplus -S user/passwd@host <
因为是在unix下写的,没有中文,抱歉。 As all known, sybase run a sql script like this: isql -Usa -P -i my.sql can we run a sql script like a unix shell script? the answer is YES! you may find that in some shell script(my.sh here), the first statement is: #!/bin/ksh ... notice the sign # is not a comment here, it really do something. it will accept $0 as his one and only one argument. so, the actua...
shell> ./bin/mysql -u root -p 提示输入密码,输入yourpassword后,出现mysql>提示符,表示已经登录系统, 执行下列命令,来建立jforum库,以及密码设定为:jforum : mysql> CREATE DATABASE jforum DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; mysql> grant all privileges on *.* to jforum@'%' identified by "jforum"; mysql> flush privileges; 我想把上面的步骤写进shell脚本里 该怎么写...
各位,由于某些原因,我不能采用存储过程嵌套调用的方式。因此我想在sql脚本、shell文件或批处理文件中获取一个存储过程的输出变量。 下面是出错的例子: CREATE PROCEDURE BORISZHANG.outtest (out completed int) ------------------------------------------------------------------------ -- sql 存储过程 ------------------------------------------------------------------------ P1: BEGIN DECLARE tabname VARCH...
各位,由于某些原因,我不能采用存储过程嵌套调用的方式。因此我想在sql脚本、shell文件或批处理文件中获取一个存储过程的输出变量。 下面是出错的例子: CREATE PROCEDURE BORISZHANG.outtest (out completed int) ------------------------------------------------------------------------ -- sql 存储过程 ------------------------------------------------------------------------ P1: BEGIN DECLARE tabname VARCH...
As all known, sybase run a sql script like this: isql -Usa -P -i my.sql can we run a sql script like a unix shell script? the answer is YES! you may find that in some shell script(my.sh here), the first statement is: #!/bin/ksh ... notice the sign # is not a comment here, it really do something. it will accept $0 as his one and only one argument. so, the actual effect is /bin/ksh $0 e.g. when you...
各位,由于某些原因,我不能采用存储过程嵌套调用的方式。因此我想在sql脚本、shell文件或批处理文件中获取一个存储过程的输出变量。 下面是出错的例子: CREATE PROCEDURE BORISZHANG.outtest (out completed int) ------------------------------------------------------------------------ -- sql 存储过程 ------------------------------------------------------------------------ P1: BEGIN DECLARE tabname VA...