[db2~]root# mysql -uroot test
[db2~]mysql> create table city(
[db2~]mysql> id mediumint unsigned not null auto_increment primary key,
[db2~]mysql> name varchar(20) not null default ''
[db2~]mysql> ) engine = ndbcluster default charset utf8;
[db2~]mysql> insert into city values(1, 'city1');
[db2~]mysql> insert into city values(2, 'city2');
在db3上,查询数据:
[db3~]root# mysql -uroot test
[db2~]mysql> select * from city;
+-----------+
|id | name |
+-----------+
|1 | city1 |
+-----------+
|2 | city2 |
+-----------+
七、安全关闭
要想关闭 Cluster,可在MGM节点所在的机器上,在Shell中简单地输入下述命令: