The method of how to realize MySQL Sub-Library and Table with the help of MyCat
This article is about how to use MyCat to achieve MySQL sub-library sub-table method. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.
❝
With the help of MyCat to achieve the MySQL sub-database sub-table landing, has not been implemented, or do not understand can see
❞this article uses the environment MySQL 8.0 Centos 7.3 1, MyCat installation
To avoid prompting advertising questions, open the official address of MyCat to copy the download address, which is not provided here.
The virtual machine used by Kaka is centos7.3, and the jdk that requires the environment is already available, so you are no longer writing tutorials. If not, Baidu search can be done!
The following figure shows the successful installation package
Decompress: tar-zxvf Mycat-server-1.6.7.1-release-20200209222254-linux.tar.gz. After decompression, there will be a mycat directory under the directory.
Create a new MySQL user
Need to create a new MySQL user to connect to Mycat
Here is the process of creating a user
/ / create a mycat user
CREATE USER 'mycat'@'%' IDENTIFIED BY' mycat'
/ / change the password
ALTER USER 'mycat'@'%' IDENTIFIED WITH mysql_native_password BY' Fang,1996'
/ / Refresh permissions
FLUSH PRIVILEGES
3. Configure MyCat
Configuration item 1: server.xml
The new MySQL user mycat created above is used here, and the logic library that can be managed is mycat_order, corresponding to the