
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
Upgrading a Docker Installation of MySQL
Before upgrading the docker installation of MySQL, ensure that the below mentioned steps have been followed −
Download a MySQL server docker image.
Start a MySQL server instance.
Connect to MySQL server instance from within the container.
Following are the steps to upgrade a Docker installation of MySQL 5.7 to 8.0 −
Stop the MySQL 5.6 server using the below command. Here mysql56 is the name of the container.
docker stop mysql56
Download the MySQL 5.7 Server Docker image.
Start a new MySQL 5.7 Docker container with the help of the old server data and configuration.
Perform modifications if required.
If MySQL community server is present, run the below command −
docker run --name=mysql57 \ --mount type=bind,src=/path-on-host-machine/my.cnf,dst=/etc/my.cnf \ --mount type=bind,src=/path-on-host-machine/datadir,dst=/var/lib/mysql \ -d mysql/mysql-server:5.7
If required, adjust mysql/mysql-server to the correct repository name.
Wait for the server to finish the startup operations.
The status of the server can be checked for using the ‘docker ps’ command.
Run the mysql_upgrade utility in the MySQL 5.7 Server container using the below command −
docker exec -it mysql57 mysql_upgrade -uroot -p
When it prompts, enter the root password for the old MySQL 5.6 Server.
Finish the upgrade by restarting the MySQL 5.7 Server container using the below command −
docker restart mysql57
- Related Articles
- Upgrading MySQL on Windows
- Steps to upgrade a MySQL installation
- MySQL Installation Related Programs
- Upgrading MySQL with the MySQL Yum Repository
- Upgrading MySQL with the MySQL APT Repository
- Upgrading MySQL with the MySQL SLES Repository
- mysql_secure_installation - Improve MySQL Installation Security
- Creating a MySQL Docker Container
- Upgrading MySQL with Directly-Downloaded RPM Packages
- Important MYSQL Performance Tuning and Settings after Installation
- Upgrading MySQL Binary or Package-based Installations on Unix/Linux
- Introduction and Installation of Nightmare.js
- Introduction and Installation of Svelte
- Equivalent of Docker option --config in docker-compose
- Cypress Installation (Test Automation)
