MySQL creates multiple tables, same table structure, different table names

Source: Internet
Author: User
Tags unique id

#!/bin/bash
For i in {0..63}
Do
mysql-u$1-p$2-h127.0.0.1 <<eof
Use Yoon;
CREATE TABLE Ivc_pre_detail_$i
(
ID bigint NOT NULL,
RefId bigint,
Detailtype smallint,
wid int comment ' Product number ',
Wname varchar (comment ' product name '),
num int comment ' Merchandise quantity ',
Price Decimal (16,6) Comment ' Commodity prices ',
Unit varchar (Ten) Comment ' Commodity units ',
Spec varchar (comment) ' spec model ',
TaxRate Decimal (16,6),
UUID varchar (comment) ' anti-weight unique ID ',
createtime datetime comment ' creation time ',
Hashtime datetime Comment ' sub-Library time ',
Primary KEY (ID)
) Engine=innodb DEFAULT Charset=utf8;
ALTER TABLE ivc_pre_detail_$i comment ' general ticket temporary pre-enlightened fine ';
Eof
Done

MySQL creates multiple tables, same table structure, different table names

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.