Skip to content
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

Windows无法运行 #52

Open
WWILLV opened this issue May 7, 2019 · 6 comments
Open

Windows无法运行 #52

WWILLV opened this issue May 7, 2019 · 6 comments
Labels
good first issue Good for newcomers

Comments

@WWILLV
Copy link

WWILLV commented May 7, 2019

1.png
2.png
3.png
4.png

数据库正常且可以连接,但是无法成功运行
auxpi:runtime error: index out of range

Request Method: GET
Request URL: /
RemoteAddr: 127.0.0.1

Stack
/usr/local/Cellar/go/1.11/libexec/src/runtime/asm_amd64.s:522
/usr/local/Cellar/go/1.11/libexec/src/runtime/panic.go:513
/usr/local/Cellar/go/1.11/libexec/src/runtime/panic.go:44
/Users/aimer/go/src/github.com/auxpi/controllers/index.go:39
/Users/aimer/go/src/github.com/auxpi/controllers/index.go:74
/usr/local/Cellar/go/1.11/libexec/src/runtime/asm_amd64.s:522
/usr/local/Cellar/go/1.11/libexec/src/reflect/value.go:447
/usr/local/Cellar/go/1.11/libexec/src/reflect/value.go:308
/Users/aimer/go/pkg/mod/github.com/astaxie/beego@v1.11.1/router.go:852
/usr/local/Cellar/go/1.11/libexec/src/net/http/server.go:2741
/usr/local/Cellar/go/1.11/libexec/src/net/http/server.go:1847
/usr/local/Cellar/go/1.11/libexec/src/runtime/asm_amd64.s:1333

报错基本都是
[Models Error]: sql: database is closed ===>[options.go:60]

@0xDkd
Copy link
Owner

0xDkd commented May 7, 2019

抱歉,最近有点忙,一直没有更新教程,现在数据库连接需要在 app.conf 中进行修改,感谢反馈

@WWILLV
Copy link
Author

WWILLV commented May 7, 2019

我在app.conf也配置了,两边都修改了,还是不行。我第三张图就是app.conf的配置

@0xDkd
Copy link
Owner

0xDkd commented May 7, 2019

重新migrate即可

@LynnScarlett
Copy link

LynnScarlett commented May 7, 2019

也许是你migrate的时候没有执行成功,如果有报
Error 1366: Incorrect string value: '\xE5\xB0\x81\xE7\xA6\x81...' for column 'display_name' at row 1等等类似的话,原因是你的数据库的字符集不支持中文。执行

mysql>use auxpi;
mysql>alter database auxpi character set utf8;

重新migrate即可。

@0xDkd 0xDkd added the good first issue Good for newcomers label May 7, 2019
@0xDkd
Copy link
Owner

0xDkd commented May 14, 2019

@WWILV 我知道原因了,你是用的是源代码吧,源码目前有一些小bug,但是最新编译的版本没有这些bug,如果你要用运行源码的话,在app.conf中添加一行

dbUser=你的数据库用户名

即可

@LCYLYM
Copy link

LCYLYM commented Feb 26, 2020

抱歉,最近有点忙,一直没有更新教程,现在数据库连接需要在 app.conf 中进行修改,感谢反馈

emmmmmm我太难了。怪不得一直sql: database is closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants