k3s-io / kine

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

mysql: creation of database with hyphen fails #148

Open dakraus opened 1 year ago

dakraus commented 1 year ago

Hey all,

when using kine with MySQL and a database name with a hyphen (e.g. kine-test), kine fails with

time="2022-11-28T10:27:28Z" level=fatal msg="building kine: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-test' at line 1"

because the database name is not quoted in the CREATE DATABASE statement.

dakraus commented 1 year ago

I created PR #149 as a possible solution.