k3s-io / kine

Run Kubernetes on MySQL, Postgres, sqlite, dqlite, not etcd.
Apache License 2.0
1.49k stars 226 forks source link

k3s mysql数据库存储kine表 #260

Closed yujun4464 closed 6 months ago

yujun4464 commented 6 months ago

mysql数据库提前创建好kine表,再用DML权限帐号连接数据库报错,没权限。请问 k3s mysql连接怎么支持DML权限?

brandond commented 6 months ago

Kine always runs a "CREATE DATABASE IF NOT EXISTS" command during startup. If this results in an error, kine will not be able to run. There is not currently any way to disable this behavior; k3s needs permission to execute that command.

yujun4464 commented 6 months ago

如果我提前创建好kine表呢?是不是就不需要DDL权限了?我尝试了下,提前创建好kine表,还是会报错 Access Denied for user

brandond commented 6 months ago

No. K3s will run the create command regardless of whether or not the database or table already exist.

yujun4464 commented 6 months ago

有什么办法能解决“无法使用DDL权限,但是又要用mysql 存储 k3s” 这个问题嘛?

brandond commented 6 months ago

No. Give the user the permissions required to run the create statements.