Advanced (or adventurous) users can repair their databases without uploading them.
If you’ve been using Zotero syncing and your data is all online, you should not follow these steps. Simply close Zotero, delete zotero.sqlite in your Zotero data directory, reopen Zotero, and let it sync to rebuild your database from the online library.
If you have no other choice, these steps may help you repair your database. Be sure to make a backup of your entire Zotero data directory before continuing.
Then type the following commands in Terminal:
Your Zotero database should no longer be corrupted, though it may be missing data or otherwise in an invalid state. If things seem to be working properly, you can delete the zotero.sqlite.old file.
Post to the Zotero Forums with any problems.
Same as the macOS instructions, with appropriate modifications.