咱们在win10如何执行以.sh文件的脚本呢?mysql
开发步骤:1.写脚本b2q_goods.shgit
#!/bin/bash
sql="select * from b2q.goods where goods_uuid=10;"
mysql="mysql -hlocalhost -uroot -proot"
echo "${sql}"
${mysql} -N -e "${sql}"sql
2.而后 win+R 输入cmd 找到咱们数据库bin 的目录 而后右键git bash hhere 若是没有安装git ,就行以下操做数据库
在git执行.sh文件。咱们须要加上而后使用 source 命令或者 \. 这个关键字前缀。 这种模式。登陆数据库的信息全在脚本之中。bash