代码改变世界

shell mysql 直接创建表

2017-07-01 12:09  freefei  阅读(2260)  评论(0)    收藏  举报

shell 直接创建表


#!/bin/bash
mysql -hdatabases -uroot  -p^xxxxasdasdadd <<EOF
        Create Database If Not Exists MyDB Character Set UTF8;
        Create Table If Not Exists MyDB.MyTable(
                ID Bigint(8) unsigned Primary key Auto_Increment,
                thTime DateTime,
                name  VarChar(128)
        )Engine MyISAM


@ https://github.com/ranmufei