Rate This Document
Findability
Accuracy
Completeness
Readability

Configuring MyCAT

  1. Configure the server file. The server file stores MyCAT configuration parameters, port, and user data.
    1. Open the file.
      1
      vim /usr/local/mycat/conf/server.xml
      
    2. Modify the following information in bold and comment out lines 122 to 129:
      • password: password of the service user
      • schemas: logical database. This document uses sysbench as an example.
      • defaultSchema: default logical database. This document uses sysbench as an example.
       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
       <user name="root" defaultAccount="true">
                <property name="password">1234567</property>
                <property name="schemas">sysbench</property>
                <property name="defaultSchema">sysbench</property>
                <!--No MyCAT Database selected. This error is reported if the schema is not set (null). The system attempts to use sysbench as the schema before this error prompts.-->
                
                <!-- Table-level DML permission setting -->
                <!--
                <privileges check="false">
                        <schema name="TESTDB" dml="0110" >
                                <table name="tb01" dml="0000"></table>
                                <table name="tb02" dml="1111"></table>
                        </schema>
                 </privileges>
                  -->
        </user>
      <!--
        <user name="user">
                <property name="password">user</property>
                <property name="schemas">TESTDB</property>
                <property name="readOnly">true</property>
                <property name="defaultSchema">TESTDB</property>
        </user>
      -->
      

    3. Press Esc, type :wq!, and press Enter to save the file and exit.