When we first log in using a client, we can use an account with a name of root and a password of 123456. This account is a default user created by Mycat to us, so where is the user assigned or how to create it? The problem is actually very simple, we see in the Mycat directory there is a conf directory, which is used to store the configuration file directory, which has a configuration file called Server.xml. Open this file, we are very aware of the user's configuration.
<?xml version= "1.0" encoding= "UTF-8"?> <!
DOCTYPE mycat:server SYSTEM "Server.dtd" >
<mycat:server xmlns:mycat= "http://io.mycat/" >
<user Name= "root" >
<property name= "password" >123456</property>
<property name= "Schemas" > Testdb</property>
<!--table-level DML permission settings-->
<!--
<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>
</user >
</mycat:server>
With some of the other configurations removed, we can see that users can configure the user's configuration by nesting the property tags by configuring the user to connect to them via the User tab. For example password is the password, schemas is able to connect the database. Permissions can also be configured under user.
This configuration file makes it clear that the Mycat user configuration is available. If you want to add a new user, it's OK to simply append a username tag. Specify the password and the connected database under the User tab. Of course, the database here is a virtual library that is configured in the Schema.xml configuration file. Multiple schemas are separated with commas.
The user configuration about Mycat is over here.