redhat/ubuntu .sh 执行 INSERT INTO 语句

redhat/ubuntu .sh 执行 INSERT INTO 语句 报错 错误如下:

执行下方语句报错:

错误写法:mysql depot -N -e  INSERT INTO `T_SYS_ENV` VALUES ('51', 'smType', '国密类型 D0 旧 G0新' , 'G0', null,'云平台配置'); 

错误:bash: syntax error near unexpected token `('

解决方案:

正确写法:用 ``  包裹执行的命令,用 ”“  包裹sql 语句 `msyql [database] -N -e "[CRUD语句]"`

示例:`mysql depot -N -e "INSERT INTO  T_SYS_ENV  VALUES ('51','smType','国密类型 D0 旧 G0 新','G0',null,'云平台配置');"`

 执行结果:

只限阅读,未经允许不得转载,如有问题请@本人,如我方内容侵权请及时告知我方。
原文地址:https://www.cnblogs.com/wzy-525/p/14307134.html