ChatGPT-API-server icon indicating copy to clipboard operation
ChatGPT-API-server copied to clipboard

Win10 and win2012 cannot create a database

Open bilili-syy opened this issue 2 years ago • 10 comments

I manually created auth.db under the Data folder and still got Failed to create database. Neither the administrator can run cmd nor the powershell administrator can run it.

bilili-syy avatar Jan 05 '23 11:01 bilili-syy

Might be that Windows is missing SQLite drivers by default. You can try printing what the error is by modifying the code.

acheong08 avatar Jan 05 '23 13:01 acheong08

可能是 Windows 默认缺少 SQLite 驱动程序。 您可以尝试通过修改代码来打印错误是什么。

I'll try it, thx

bilili-syy avatar Jan 05 '23 13:01 bilili-syy

I have already configured sqlite3 still not working

bilili-syy avatar Jan 05 '23 14:01 bilili-syy

Print the error. See what the error is

acheong08 avatar Jan 05 '23 14:01 acheong08

https://github.com/ChatGPT-Hackers/ChatGPT-API-server/commit/41250d1d74d461241fdb7a816c78cec823b37619

acheong08 avatar Jan 05 '23 14:01 acheong08

Print the error. See what the error is

Solved, but weird. The version of Releases does not work properly. Compiled locally works fine.

bilili-syy avatar Jan 05 '23 14:01 bilili-syy

There is something wrong with the workflow. Not sure exactly what

acheong08 avatar Jan 05 '23 14:01 acheong08

Failed to create database: error creating table: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub。I downloaded 0.3.0 the error shown

bilili-syy avatar Jan 05 '23 15:01 bilili-syy

The command I use to compile locally: go build -ldflags "-s -w -extldflags '-static'". The compiled file is no problem

bilili-syy avatar Jan 05 '23 15:01 bilili-syy

It works without any flags for me. It might be just because CGO_ENABLED=0

acheong08 avatar Jan 05 '23 15:01 acheong08