This chapter will introduce how to use DistSQL to manage resources and rules in a distributed database.
Introduction #
We will here use MySQL as example, but the same can be applicable to other databases.
- Start the MySQL service.
- Create to be registered MySQL databases.
- Create role and user in MySQL with creation permission for DBPlusEngine-Proxy.
- Start Zookeeper service.
- Add
modeandauthenticationconfigurations toserver.yaml. - Start DBPlusEngine-Proxy.
- Use SDK or terminal connect to DBPlusEngine-Proxy.
Create Logic Database #
- Create logic database
CREATE DATABASE foo_db;
- Use newly created logic database
USE foo_db;
Resource Operation #
For more details please see concentrate rule examples.
Rule Operation #
For more details please see concentrate rule examples.
Notice #
- Currently,
DROP DATABASEwill only remove thelogical distributed database, not the user’s actual database. DROP TABLEwill delete all logical fragmented tables and actual tables in the database.CREATE DATABASEwill only create alogical distributed database, so users need to create actual databases in advance.