Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize MySQL single database and sub-table in Mycat

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

How to implement MySQL single database sub-table in Mycat? in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

I. Mycat installation and deployment

Currently, only version 1.6.5 of the installation environment Linux supports separate tables in a single database. After downloading Mycat 1.6.5 wget http://dl.mycat.io/1.6.5/Mycat-server-1.6.5-release-20171029183033-linux.tar.gz, modify the configuration file under mycat/conf

1. Modify server.xml

Set user name,password and schemas. Name and password should be used when Mycat connects to the MySQL database. Schemas is a logical library and corresponds to the schema name in schema.xml.

two。 Modify schema.xml

As shown in the figure, schema name should correspond to server.xml, and the user table can set ten sub-tables, and only one datanote,rule can be set to use the mode mod-long. WriteHost and readHost are set to the same database.

3. Modify rule.xml

Choose the default mod-long rule this time. You only need to modify the number of count and correspond to the number of subTables.

The modified property count equals 10.

In this way, the configuration is complete.

Start Mycat and connect to MySQL

First, on the MySQL library, build 10 tables, user1-user10.

1. Go to the bin directory under the Mycat package and start Mycat

. / mycat start

two。 Connect MySQL

Mysql-utest-ptest-h227.0.0.1-P8066-Dzhenxui

3. Query Mycat users

All 10 sub-tables were found.

5. Insert data to the library

This is the answer to the question about how to achieve MySQL single-database sub-table in Mycat. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report