Update MySQL from 5.7 to 8.0 with Docker

What is this

How to update Docker's MySQL from 5.7 to 8.0. It is assumed that you are using docker compose.



- FROM mysql:5.7
+ FROM mysql:8.0

Rewrite the version of docker / mysql / Dockerfile.

docker-compose build mysql

It will be upgraded by docker-compose build. If not docker-compose build --no-cache mysql Please try with.

When you start the mysql container again, the data will be upgraded automatically and you can use it as MySQL 8.0. Please note that once the data has been upgraded, it may not work with older versions of MySQL.

Solving problems with Laravel

The default auth plugin has changed from mysql8 Laravel does not support it and the following error occurs.

SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from `users` where 

Therefore, set the following settings in my.conf.


default-authentication-plugin = mysql_native_password

I hope you find this helpful.

Recommended Posts

Update MySQL from 5.7 to 8.0 with Docker
Deploy to heroku with Docker (Rails 6, MySQL)
Create a MySQL environment with Docker from 0-> 1
[Docker] Connection with MySQL
Setting to exit from Docker container with VScode
Migrating from vargrant to docker
How to update with activerecord-import
Connect to MySQL 8 with Java
Rails + MySQL environment construction with Docker
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ Express ~
Read dump file with Docker MySQL
mysql2 fails to install with bundle install
Upgrade from MYSQL5.7 to 8.0 on CentOS 6.7
Change DB from SQLite to MySQL
How to use mysql with M1 mac Docker preview version
We aim to update daily from 2021
mysql doesn't start up with docker.
docker-compose.yml when you want to keep mysql running with docker
How to start Camunda with Docker
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ MySQL edition ~
PostgreSQL environment construction with Docker (from setup to just before development)
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ Sequelize ~
Investigate the replacement from Docker to Podman.
Create Rails 6 + MySQL environment with Docker compose
[Rails] How to use rails console with docker
Edit Mysql with commands in Docker environment
Connect from Java to MySQL using Eclipse
Introduced vscode with apt to docker: ubuntu
[Docker] Copy files from docker container to host
Laravel + MySQL + phpMyadmin environment construction with Docker
Implement simple CRUD with Go + MySQL + Docker
How to run Blazor (C #) with Docker
How to build Rails 6 environment with Docker
After all I wanted to preview the contents of mysql with Docker ...
Sample to create PDF from Excel with Ruby
I tried to verify AdoptOpenJDK 11 (11.0.2) with Docker image
Connect to Aurora (MySQL) from a Java application
How to get a heapdump from a Docker container
Rails6 [API mode] + MySQL5.7 environment construction with Docker
Copy files from docker container to host (docker cp)
How to update pre-built files in docker container
How to give your image to someone with docker
Update container image with KUSANAGI Runs on Docker
I want to play with Firestore from Rails
How to use docker compose with NVIDIA Jetson
React + Django + Nginx + MySQL environment construction with Docker
DataSource connection from WebSphere to MySQL (DataSource property change?)
How to use nginx-ingress-controller with Docker for Mac
Easy to display hello world with Rails + Docker
Temporarily move Docker environment from Mac to AWS
Connect with VS Code from a Windows client to Docker on another server
Launch Docker from Java to convert Office documents to PDF
[Road _node.js_1-1] Road to build Node.js Express MySQL environment using Docker
How to connect MySQL / MariaDB + HikariCP with Liferay 7 / DXP
Changes from Java 8 to Java 11
Sum from Java_1 to 100
[Introduction to Docker x ECS] ECS deployment with docker compose up
Conveniently insert / update records with MySQL INSERT ... ON DUPLICATE KEY UPDATE
Migrate from JUnit 4 to JUnit 5
Whether to enable SSL when using JDBC with MySQL.
How to build docker environment with Gradle for intelliJ