kingshard icon indicating copy to clipboard operation
kingshard copied to clipboard

user [root] must have a schema

Open micky09119 opened this issue 5 years ago • 1 comments

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 管理的 单机两个实例

micky09119 avatar Sep 12 '19 12:09 micky09119

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:
-   

jtxwmf avatar Jan 10 '20 08:01 jtxwmf