Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-13T04:35:43.690Z
Comments.Text: "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?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-15T10:21:31.643Z
Comments.Text: Thanks, Brad. Edited to include screenshot. Bit of an odd one this.
Comments.UserDisplayName: Martin
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-19T21:44:53.290Z
Comments.Text: Can you try restoring using the `mysql` command line directly? Or some other database client?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-02-14T14:46:53.730Z
Comments.Text: 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.
Comments.UserDisplayName: Martin
Tags: <craft3><database>
Title: Why is my database stuck at the 'Creating sort index' query?
ThreadText: # 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, username_1. 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
  
  