
- 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 MySQL Binary or Package-based Installations on Unix/Linux
Let us understand how MySQL binary and package-based installations can be upgraded in Unix or Linux. This can be done in-place as well as by using a logical upgrade method. Let us understand both these methods in brief −
In place upgrade
An in−place upgrade involves shutting down the old MySQL server, replacing the old MySQL binaries or the packages with the new ones.
Once this is done, the MySQL server is restarted on the existing data directory.
After this, the remaining parts of the existing installation, that require some kind of upgrade, are upgraded.
For some Linux platforms, MySQL installation from RPM or Debian packages will include ‘systemd’ support that helps manage MySQL server startup and shut down.
The command ‘mysqld_safe’ wouldn’t have been installed on such systems.
Logical Upgrade
A logical upgrade involves exporting the SQL from old MySQL instance.
The existing data needs to be exported from the previous MySQL installation, which can be done using the below command -
mysqldump -u root -p --add-drop-table --routines --events --all-databases --force > data-for-upgrade.sql
The old MySQL server is shut down using the below command −
mysqladmin -u root -p shutdown
A new data directory is initiated using the below command −
mysqld --initialize --datadir=/path/to/8.0-datadir &
Reset the root password using the below command −
shell> mysql -u root -p Enter password: **** <− enter temporary root password mysql> ALTER USER USER() IDENTIFIED BY 'your new password';
Load the previously created dump file into the newly created MySQL server using the below command −
mysql -u root -p --force < data-for-upgrade.sql
MySQL Cluster Upgrade
The MGM nodes are upgraded.
The data nodes are upgraded one at a time.
The API nodes are upgraded one at a time, and this includes the MySQL servers.
The data dictionary is upgraded.
The system tables are upgraded.
The system is restarted.
- Related Articles
- Downgrading Binary and Package-based Installations on Unix/Linux
- Installing MySQL on Unix/Linux Using Generic Binaries
- Upgrading MySQL on Windows
- Init process on UNIX and Linux systems
- Perl Installation on Unix and Linux Platform
- What are Named Pipes or FIFO in Linux/Unix systems?
- How to change file or directory permission in Linux/Unix?
- Difference between Linux and Unix
- Converting decimal to binary or hex based on a condition in JavaScript
- Linux Package Management with Aptitude
- Upgrading MySQL with the MySQL Yum Repository
- Upgrading MySQL with the MySQL APT Repository
- Upgrading MySQL with the MySQL SLES Repository
- Installing MySQL on Linux
- Select all duplicate MySQL rows based on one or two columns?
