正在显示
1 个修改的文件
包含
3 行增加
和
2 行删除
@@ -2,7 +2,7 @@ package starrocks | @@ -2,7 +2,7 @@ package starrocks | ||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "database/sql" | 4 | "database/sql" |
5 | - _ "github.com/go-sql-driver/mysql" | 5 | + mysql "github.com/go-sql-driver/mysql" |
6 | "gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/constant" | 6 | "gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/constant" |
7 | "gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/log" | 7 | "gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/log" |
8 | "time" | 8 | "time" |
@@ -12,7 +12,8 @@ var DBOfficial *sql.DB | @@ -12,7 +12,8 @@ var DBOfficial *sql.DB | ||
12 | 12 | ||
13 | func InitDBOfficial() error { | 13 | func InitDBOfficial() error { |
14 | var err error | 14 | var err error |
15 | - DBOfficial, err = sql.Open("mysql", constant.STARROCKS_MYSQL_DATA_SOURCE) | 15 | + sql.Register("mysql-star", &mysql.MySQLDriver{}) |
16 | + DBOfficial, err = sql.Open("mysql-star", constant.STARROCKS_MYSQL_DATA_SOURCE) | ||
16 | if err != nil { | 17 | if err != nil { |
17 | return err | 18 | return err |
18 | } | 19 | } |
-
请 注册 或 登录 后发表评论