<?xml version="1.0"?>
<!DOCTYPE mycat:schema SYSTEM "schema.dtd">
<mycat:schema xmlns:mycat="http://io.mycat/">
<schema name="QUAN" checkSQLschema="true" sqlMaxLimit="100">
<table name="TB_TEST" dataNode="dn1" primaryKey="id"/>
</schema>
<dataNode name="dn1" dataHost="localhost1" database="db1" />
<dataHost name="localhost1" maxCon="1000" minCon="10" balance="1" writeType="0" dbType="mysql"
dbDriver="native" switchType="1" slaveThreshold="100">
<heartbeat>select user()</heartbeat>
<writeHost host="hostM1" url="192.168.88.3:3306" user="root" password="123456">
<readHost host="hostS1" url="192.168.88.4:3306" user="root" password="123456" />
</writeHost>
</dataHost>
</mycat:schema>
<user name="root" defaultAccount="true">
<property name="password">123456</property>
<property name="schemas">QUAN</property>
</user>
<user name="user">
<property name="password">123456</property>
<property name="schemas">QUAN</property>
<property name="readOnly">true</property>
</user>
- 为了方便测试查看日志,修改log42.xml, level=“debug”
<asyncRoot level="debug" includeLocation="true">
bin/mycat start

mysql -h 127.0.0.1 -P 8066 -uroot -p

select * from TB_TEST;

insert into TB_TEST(id,title) VALUES(3,'quan');
