This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table gift( | |
id int auto_increment, | |
name varchar(255), | |
description text, | |
created_at datetime not null, | |
primary key(id) | |
)engine=InnoDB; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
i=0 | |
while ((1)) | |
do | |
name=$(uuidgen | tr -d '-') | |
desc=$(mkpasswd -l 1000) | |
mysql -u xxxxxxx cloudpack -pxxxxxxxxxxxxx -e "INSERT INTO gift(name, description,created_at) VALUES('${name}', '${desc}', NOW());" | |
echo "." | |
sleep 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GRANT ALL PRIVILEGES ON *.* TO 'xxxxxxxxxxxxxx'@localhost IDENTIFIED BY 'xxxxxxxxxxxxxx'; | |
GRANT ALL PRIVILEGES ON *.* TO 'xxxxxxxxxxxxxx'@'%' IDENTIFIED BY 'xxxxxxxxxxxxxx'; | |
use cloudpack; | |
create table gift( | |
id int auto_increment, | |
name varchar(255), | |
description text, | |
created_at datetime not null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table gift_new( | |
id int auto_increment, | |
name varchar(255), | |
description text, | |
created_at datetime not null, | |
primary key(id) | |
) engine = Spider DEFAULT CHARSET=utf8 | |
CONNECTION ' table "gift", user "xxxxxxxxxxxxx", password "xxxxxxxxxxxxx" ' | |
PARTITION BY LIST(MOD(id, 2)) ( | |
PARTITION hostb VALUES IN (0) comment 'host "111.111.111.111", port "3306"', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> rename table | |
gift_dummy to gift_delete, | |
gift to gift_dummy, | |
gift_vp to gift; | |
Query OK, 0 rows affected (0.03 sec) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select vp_copy_tables('gift', 'gift_dummy', 'gift_new'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> rename table | |
gift to gift_vp, | |
gift_new to gift; | |
Query OK, 0 rows affected (0.01 sec) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop table | |
gift_dummy, | |
gift_vp, | |
gift_delete; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> rename table | |
gift_dummy to gift_delete, | |
gift to gift_dummy, | |
gift_vp to gift; | |
Query OK, 0 rows affected (0.03 sec) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> select * from gift order by id; | |
+------+----------------------------------+----------------------------------+---------------------+ | |
| id | name | description | created_at | | |
+------+----------------------------------+----------------------------------+---------------------+ | |
| 1 | d84c7d13d56e48999f6e42396bb0d6b8 | 57b6f87681df4141953b63cd6ee74... | 2011-09-21 22:35:23 | | |
| 2 | fc52fbdee1904e40a92711bc3ff5b53b | 4fe1116428e142369ab419d603a8b... | 2011-09-21 22:35:23 | | |
| 3 | 936917c0e7b246b380573654c80863e1 | 08cf01342f1149b5a7fa15f2df5b6... | 2011-09-21 22:35:24 | | |
| 4 | 5d630544409e4ef98ece5b489cd5aff5 | c3c1848832d04b69bc9f9c1bd7249... | 2011-09-21 22:35:23 | | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 5429 | 0462eaf7646b4855a993a49128ba3f4d | 0d07cdbac3c14723b25bc1a1bc74a... | 2011-09-22 01:07:42 | |
OlderNewer