简单数据库及表创建shell脚本
2012-09-10 21:03
337 查看
#!/bin/bash USER='root' PASS='123' mysql -u $USER -p$PASS <<EOF 2> /dev/null create database test1; EOF [ $? -eq 0 ] && echo "The database Created test1" || echo "The database test1 is already exist" mysql -u $USE test1 <<EOF 2> /dev/null create table test1( ind int, name varchar(20) ); EOF [ $? -eq 0 ] && echo "The table Created test1" || echo "The table test1 is already exist" mysql -u $USER -p$PASS test1 <<EOF DELETE FROM test1; EOF
相关文章推荐
- 简单数据库及表创建shell脚本
- 简单数据库及表创建shell脚本
- shell脚本操作mysql数据库—创建数据库,在该数据库中创建表(插入,查询,更新,删除操作也可以做)
- 自动创建数据库并按顺序导入sql文件的shell脚本
- 一个简单的自动创建Shell脚本的脚本
- 简单的shell数据库备份脚本
- 一个创建用户的简单的shell脚本
- SQL脚本文件创建数据库(简单示例)
- shell脚本来批量创建和删除数据库
- 简单的shell脚本备份数据库和代码
- shell脚本:实现MySQL创建数据库和删除数据库的脚本
- 使用linux客户端执行shell脚本创建数据库初始化数据库中文乱码问题
- 简单的通过shell脚本接收参数进行数据库操作
- shell脚本批量创建用户,并指定随机密码
- shell连接mysql并创建数据库表
- 用批处理调用sql脚本创建数据库和表
- linux简单命令与Shell脚本
- 如何在交互式shell脚本中创建对话框
- Shell脚本批量创建用户并随机生成密码