How to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.x on Linux?
Important Links
- VLE Insurance Process Flow
- RAP Registration Flow
- RAP and VLE INS POSP
- Life Insurance
- Life Insurance Renewal
- Motor Comprehensive
- Motor Third Party
- Personal Accident
- Fire and Allied Perils
- Health Insurance
- Pradhan Mantri Fasal Bima Yojana (PMFBY)
- NPS
- CSC Digipay Commission Chart
- HDFC Commission
- Axis Bank Commission
- UCO Bank Commission
- ICICI Bank Commission
- BOB Bank Commission
- BOI Bank Commission
- CBI Bank Commission
- LIFE INSURANCE RENEWAL HANDBOOK
- Difference Between CSC RAP Insurance And CSC VLE Insurance - Registration | Products | Commission
- LIC Commission
How to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.x on Linux?
Question
How to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.X on Linux?
Answer
This article provides instructions for upgrading MySQL 5.5 to 5.6/5.7 and MariaDB 5.5 to 10.0/10.1/10.2/10.3/10.4/10.5/10.6 on Linux.
Note: Upgrade can be performed in a command-line interface with the instructions below at your own risk. This task is supposed to be performed by a system administrator.
If you are not familiar with Linux system administering and would like our professionals to handle this task on your behalf, contact Professional Services team at https://www.plesk.com/professional-services/.
To find out your Linux distribution, run:
plesk version | grep "OS version"
Or:
cat /etc/*-release
Warning: MariaDB 10.11 is supported starting from Plesk Obsidian 18.0.52. MariaDB 10.4 and later versions are supported starting from Plesk Obsidian 18.0.30. Previous versions (Onyx and older) do not support MariaDB starting from 10.3 and there are no plans to implement it currently.
Warning:
Direct upgrade from MySQL 5.1 to MySQL 5.6/5.7 will break tables structure. The instructions for upgrading MySQL from 5.1 to 5.5 on Linux are available here: How to upgrade MySQL from 5.1 to 5.5 on Linux
Warning:
Direct upgrade from MariaDB 5.5 or 5.7 to MariaDB 10.6 or later versions is not possible.
You should first upgrade MariaDB 5.5. or 5.7 to any MariaDB from 10.3 to 10.5, and then perform an update to MariaDB 10.6 or later
It is strongly recommended to create a server snapshot (full backup) before upgrading. Perform MySQL upgrade at your own risk.
Before starting a MySQL upgrade, stop the WatchDog service if it is used on a server. Check its status with the service watchdog status
command.
Note: MySQL will not be upgraded on CentOS/RHEL-based operating systems if it was installed from the Webtatic Yum repository:
rpm -qa | grep -i mysql
mysql55w-server-5.5.57-1.w6.x86_64
To start an upgrade of MySQL/MariaDB, connect to a server via SSH as root/superuser and follow the instructions for your operating system:
Plesk on CentOS 7 / RHEL 7
By default, CentOS 7 is shipped with MariaDB 5.5. MariaDB 10.x version is a drop-in replacement for MySQL 5.5-5.7.
Automatic method
Note: The script below is applicable only for upgrading default MariaDB 5.5 to the MariaDB 10.5 version, for other cases apply the steps from the Manual Method section. Make sure Obsidian 18.0.30 or later is installed on the server.
-
Download the attached script and provide it with executable rights:
-
wget https://raw.githubusercontent.com/plesk/kb-scripts/master/c7-mariadb-10-5-upgrade/c7-mariadb-10-5-upgrade.sh && chmod +x c7-mariadb-10-5-upgrade.sh
-
Execute the script via CLI:
-
./c7-mariadb-10-5-upgrade.sh
Manual Method
-
For security reasons, create a database dump of all databases with the following command:
-
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin --verbose --all-databases --routines --triggers > /root/all-databases.sql
-
Stop MariaDB:
-
service mariadb stop
-
Remove additional
mariadb-bench
package if installed: -
rpm -e --nodeps mariadb-bench
-
For security reasons, copy the database directory in a separate folder:
-
cp -v -a /var/lib/mysql/ /var/lib/mysql_backup
-
Check if the mariadb-server package is already installed:
rpm -q --whatprovides mariadb-server
If it is installed and the command above gives output, remove using the following command:
-
rpm -e --nodeps `rpm -q --whatprovides mariadb-server`
-
Configure MariaDB repository:
Warning: MariaDB 10.4 and later versions are supported since 18.0.30, make sure the latest Plesk version is installed.
Here is an example for MariaDB 10.5:
6.1. The following command adds the MariaDB 10.5 repository:
-
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.5
Note: Make sure that other MariaDB repositories are not enabled in
/etc/yum.repos.d/
. -
Reset all the cache:
-
yum clean all
-
Start an upgrade of MariaDB:
-
yum install MariaDB-client MariaDB-server MariaDB-compat MariaDB-shared
- In case upgrading to MariaDB 10.6 or newer it is needed to adjust the
my.cnf
configuration file to match the new requirements: -
sed -i 's/bind-address = ::ffff:127.0.0.1/bind-address = 127.0.0.1/g' /etc/my.cnf
-
start MariaDB:
systemctl restart mariadb
OR
-
systemctl restart mysql
-
Upgrade MySQL databases:
-
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
-
Restart mysql service:
systemctl restart mariadb
OR
-
systemctl restart mysql
-
Execute this command to update the package version inside Plesk:
-
plesk sbin packagemng -sdf
Note: After an upgrade, there may appear 'mysql' init script. It should be removed to avoid conflicts with MariaDB service. The same commands can be used to fix already existing conflict:
systemctl stop mysql; killall mysqld # to stop the incorrect service if it is started
# rm -f /etc/init.d/mysql && systemctl daemon-reload # to remove the incorrect service script and reload systemctl configuration
# systemctl start mariadb # to start MariaDB if not started
# systemctl enable mariadb # to make sure that MariaDB will start after the server reboot automatically
Latest POst
- LPG Gas Subsidy Check by mobile number
- PMEGP Loan Aadhar Card Se
- E Shram Card Balance Check Number
- How to Migrate CentOS 7 to AlmaLinux 8
- How to Install WHM/cPanel in Almalinux?
- Install cPanel on Rocky Linux 9 Server
- How to Link Aadhaar with UAN
- How To Setup LVS (Linux Virtual Server) Load Balancer on Rocky Linux 8.5
- Setup Quick DNS Server On Rocky Linux 8.5 Using Dnsmasq
- How To Install Ruby on Rails with Mysql on Rocky Linux 8.5
Recent Updates
- LPG Gas Subsidy Check by mobile number
- PMEGP Loan Aadhar Card Se
- E Shram Card Balance Check Number
- How to Migrate CentOS 7 to AlmaLinux 8
- How to Install WHM/cPanel in Almalinux?
- Install cPanel on Rocky Linux 9 Server
- How to Link Aadhaar with UAN
- How To Setup LVS (Linux Virtual Server) Load Balancer on Rocky Linux 8.5
- Setup Quick DNS Server On Rocky Linux 8.5 Using Dnsmasq
- How To Install Ruby on Rails with Mysql on Rocky Linux 8.5
Haryana Goverment Schemes
- Old Age Samman Allowance
- Widow Pension Scheme
- Disability Pension Scheme
- Financial Assistance to Destitute Children Scheme
- Financial Assistance to Non School Going Disabled Children
- Allowance to Dwarfs
- Allowance to Eunuchs
- Rajiv Gandhi Pariwar Bima Yojna
- Post-Matric Scholarship
- Merit Cum Means
- Pre-Matric Scholarship
- About MMPSY
- MMPSY PPT
- MMPSY HINDI Manual
- MMPSY English Manual
- Premium Chart for PMMDY (Pension Plan)
- Parivar Pehchan Patra (PPP)
- Download Family ID
- PMSVANidhi Process Flow
- PM SVANidhi through CSCs
- About PMSYM
- PMSYM Morpho Setting
- PMSYM Creative & FAQ
- PMSYM Process Manual