I usually use Nitro and docker to run Craft.

Nitro created a Docker container with MySQL 5.7. How can I change that version to MySQL 8?

  • Do you want to add MySQL 8, so you're running both 5.7 and 8.0? Or do you want to replace MySQL 5.7 with MySQL 8.0?
    – Brad Bell
    Jun 25 at 3:19
  • Hi, I want to replace MySQL 5.7 with MySQL 8 in Nitro!
    – EdisonJS
    Jun 25 at 17:02
  • @BradBell, I'm looking to have 2 different versions for 2 different servers, what would be the method to add another MySQL server on another version? Oct 18 at 19:13

Should be:

  1. From the terminal run nitro stop.
  2. From Docker Desktop, click on Containers/Apps.
  3. Find the MySQL 5.7 container and click the trash icon to remove it.
  4. From the terminal, run nitro edit.
  5. Under databases, you should see something like:
engine: mysql
version: "5.7"
port: "3306"
  1. Change "5.7" to "8.0".
  2. Save the changes.
  3. From the terminal, run nitro apply.
  • Yeah, actually that worked for me, thank you!!! First I backed up my DB, and I did that you wrote and it works perfectly. I owe you one!!
    – EdisonJS
    Jun 28 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.