-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MySQL 数据库无法连接 #62
Comments
请将https://github.com/gogf/gf/tree/master/contrib/drivers放到main的improt 加载mysql驱动 默认是sqlite |
你好,windows环境下根据文档import添加github.com/gogf/gf/contrib/drivers/mysql/v2后依然会报这个错误,应该如何解决呢? |
我也出现了同样的问题,依然无法解决 |
我通过改库文件临时解决了这个问题,在cool-admin-go\cool\initdb.go中的import里加入 改库文件只是针对本机,对于不同开发环境不适用,这种情况可以尝试在你的项目目录下
我的这个方法破坏了cool-admin-go的驱动隔离性,上不了台面,就不发pull requests了,期待作者大大更好的解决方案 |
windows 下报什么错误方便提示下么 |
在cool-admin-go\cool\initdb.go中的import里加入 |
方便提供下你的项目配置文件吗 |
好的,我的config.yaml如下:
|
github.com/cool-team-official/cool-admin-go/cool 的版本多少呢 |
你好,使用的是1.5.7最新版,go版本是1.21.5 |
按照文档进行操作,MySQL 数据库无法连接。报错如下:
panic: cannot find database driver for specified database type "mysql", did you misspell type name "mysql" or forget importing the database driver? possible reference: https://github.com/gogf/gf/tree/master/contrib/drivers [recovered]
panic: failed to connect database
goroutine 1 [running]:
github.com/cool-team-official/cool-admin-go/cool.InitDB.func1()
可能是配置文件错误
The text was updated successfully, but these errors were encountered: