flike / kingshard

A high-performance MySQL proxy
6.41k stars 1.23k forks source link

user [root] must have a schema #539

Open micky09119 opened 5 years ago

micky09119 commented 5 years ago

vagrant@vagrant:~/mygo/mygo/src/github.com/flike/kingshard$ ./bin/kingshard -config=etc/ks.yaml

__   _                  __                   __

/ /() __/ /_ __/ / / //_/ / \/ \/ / \ / \/ / / / ,< / / / / / /_/ ( ) / / / // / / / // / //|/// //_, /_// /_/\,// _,/ // Git commit:19a9415 Build time:2019-09-12 11:03:26 2019/09/12 12:26:00 - ERROR - main.go:[108] - [main] "main" "user [root] must have a schema" "" conn_id=0 请问这是什么原因导致的呢? 数据库连接正常 使用mysqld_multi 管理的 单机两个实例

jtxwmf commented 4 years ago

ks.yaml里面需要给用户名为root的用户配置schema 如果分片不是使用的root用户,由于前面

server user and password

user_list:

user :  root
password : root

- user : kingshard password : kingshard 定义了两个用户:root和kingshard 上面定义的用户都需要为其定义schema 下面是给root用户定义空schema的配置

schema defines sharding rules, the db is the sharding table database.

schema_list :

user: root
nodes: [node1,node2]
default: node1      
shard:
-