auxpi icon indicating copy to clipboard operation
auxpi copied to clipboard

Windows无法运行

Open WWILLV opened this issue 5 years ago • 6 comments

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/[email protected]/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]

WWILLV avatar May 07 '19 04:05 WWILLV

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

0xDkd avatar May 07 '19 04:05 0xDkd

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

WWILLV avatar May 07 '19 05:05 WWILLV

重新migrate即可

0xDkd avatar May 07 '19 06:05 0xDkd

也许是你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即可。

LynnScarlett avatar May 07 '19 10:05 LynnScarlett

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

dbUser=你的数据库用户名

即可

0xDkd avatar May 14 '19 12:05 0xDkd

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

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

LCYLYM avatar Feb 26 '20 06:02 LCYLYM