<p>So I imported the production database locally and it is getting stuck at the 'creating sort index' stage of the query when I try to log in to the CMS.</p>
<p>This is the Server Process table from SequelAce where it says 'creating sort index'.
<a href="https://i.sstatic.net/NBiHr.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/NBiHr.png" alt="enter image description here" /></a></p>
<p>Has anyone come across this before?</p>
<p>I've tried the stage DB too. Both many times. I, unfortunately, didn't back up my local DB before doing so.</p>
<p>All other databases and sites work fine. Creating a new database and installing craft works fine but the prod and stage databases get stuck.</p>

CC BY-SA 4.0
2022-05-13T04:35:43.690Z
"getting stuck at the 'creating sort index' stage of the query" - not sure what that is exactly - can you edit the question and share a screenshot of where you're seeing that?
Brad Bell
CC BY-SA 4.0
2022-05-15T10:21:31.643Z
Thanks, Brad. Edited to include screenshot. Bit of an odd one this.
Martin
CC BY-SA 4.0
2022-05-19T21:44:53.290Z
Can you try restoring using the `mysql` command line directly? Or some other database client?
Brad Bell
CC BY-SA 4.0
2023-02-14T14:46:53.730Z
Sorry for not returning to this sooner. 
Trying the restore command didn't work.
In the end, we could not figure this one out.
I was due a new work machine anyway so that ended up being the fix.
Martin
<craft3><database>
Why is my database stuck at the 'Creating sort index' query?
# Why is my database stuck at the 'Creating sort index' query?

(Asked by: username_0 on 2022-05-09)

So I imported the production database locally and it is getting stuck at the 'creating sort index' stage of the query when I try to log in to the CMS.

This is the Server Process table from SequelAce where it says 'creating sort index'.
[![enter image description here](https://i.sstatic.net/NBiHr.png)](https://i.sstatic.net/NBiHr.png)

Has anyone come across this before?

I've tried the stage DB too. Both many times. I, unfortunately, didn't back up my local DB before doing so.

All other databases and sites work fine. Creating a new database and installing craft works fine but the prod and stage databases get stuck.

**Tags:** craft3, database

> **Comments:**
> **username_1**: "getting stuck at the 'creating sort index' stage of the query" - not sure what that is exactly - can you edit the question and share a screenshot of where you're seeing that?  
> **username_0**: Thanks, Brad. Edited to include screenshot. Bit of an odd one this.  
> **username_1**: Can you try restoring using the `mysql` command line directly? Or some other database client?  
> **username_0**: Sorry for not returning to this sooner.  Trying the restore command didn't work. In the end, we could not figure this one out. I was due a new work machine anyway so that ended up being the fix.  

---

## 0 answers

