# Cannot delete library, corrupt database?

**URL:** <https://forums.plex.tv/t/cannot-delete-library-corrupt-database/634785>\
**Category:** Plex Media Server\
**Tags:** server-linux\
**Created:** [September 18, 2020, 9:36pm UTC](https://forums.plex.tv/t/cannot-delete-library-corrupt-database/634785 "2020-09-18T21:36:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![graphographer\_gmail\_com](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/graphographer_gmail_com/32/207033_2.png) [@graphographer\_gmail\_com](https://forums.plex.tv/u/graphographer_gmail_com)\
**Post date:** [September 18, 2020, 9:36pm UTC](https://forums.plex.tv/t/cannot-delete-library-corrupt-database/634785/1 "2020-09-18T21:36:13Z")

</div>

Server Version#: 1.20.1.3252-a78fef9a9  
Player Version#: 4.34.4

I have a library I’d like to delete, but I think due to some sort of database corruption, it won’t. I followed the Plex instructions for repairing a corrupt database, but to no avail.

Here’s what seems to be the related error from the console. (Yes, it’s cut off like that in the console.)

Any advice short of creating a new database?

```auto
SQLITE3:0x4d0, 11, statement aborts at 36: [delete from media_streams where id in (select media_streams.id from media_streams join media_items on media_items.id=media_streams.media_item_id where library_section_id=?)] database d

```

---

<div class="post-metadata">

**Author:** ![BigWheel](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/bigwheel/32/78783_2.png) [@BigWheel](https://forums.plex.tv/u/BigWheel)\
**Post date:** [September 18, 2020, 10:12pm UTC](https://forums.plex.tv/t/cannot-delete-library-corrupt-database/634785/2 "2020-09-18T22:12:55Z")

</div>

If it has not been corrupted for too long maybe the backups are ok. You can try to restore one of those.

> **[Restore a Database Backed Up via 'Scheduled Tasks' | Plex Support](https://support.plex.tv/articles/202485658-restore-a-database-backed-up-via-scheduled-tasks/)**
>
> One of the many Scheduled Tasks that a Plex Media Server performs is to make regular backups of the core...

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 17, 2020, 10:13pm UTC](https://forums.plex.tv/t/cannot-delete-library-corrupt-database/634785/3 "2020-12-17T22:13:02Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
