Jump to content

Upgrade MariaDB 10.11 In CWP Centos 7 Centos 8 stream AlmaLinux 7/8 RockyLinux 7/8


Recommended Posts

MariaDB 10.11 is now very stable and many features has been added and improved in this version you can check all lists of changes here

I’ve checked MariaDB 10.11 with WordPress, Joomla, xenforo, IPS forum and some more PHP scripts which depends on MySQL DB are working fine with this version hence it is safe to upgrade to this version.

Short description about MariaDB :

MariaDB is designed as a drop-in replacement of MySQL with more features, new storage engines, fewer bugs, and better performance. MariaDB is developed by many of the original developers of MySQL who now work for the MariaDB Foundation and the MariaDB Corporation, and by many people in the community.

Step 1 :
Remove MariaDB 10.0/10.1/10.2/10.3/10.x
To upgrade Mariadb 10.11 in Centos 7/CWP do this :
Before installing it is recommended to backup your databases, although it is not necessary if you followed this steps carefully.

First backup your current my.cnf config :

cp /etc/my.cnf /etc/my.cnf.bak


Remove MariaDB 10.0/10.1/10.2/10.3/10.xx :

systemctl stop mariadb mysql mysqld
systemctl disable mariadb
rpm --nodeps -ev MariaDB-server


At this point MariaDB 10.0/10.1/10.2/10.3.10.xx will be removed completely but the databases are not removed don’t need to worry.

Then Install MariaDB 10.11 :

Step 2 :
Installation/Updating from MariaDB 10.0/10.1/10.2/10.3/10.xx to MariaDB 10.11


To upgrade Mariadb to 10.11 in Centos 7 CWP do this :
Install/enable Official repo for mariadb 10.11:

yum install nano epel-release -y


Now edit/create the Repo file :

Ensure you don’t have any other MariaDB repo file in /etc/yum.repos.d if exists delete or backup the existing repo file :

mv /etc/yum.repos.d/mariadb.repo /etc/yum.repos.d/mariadb.repo.bak
nano /etc/yum.repos.d/mariadb.repo


then paste this lines and save it :
to install Mariadb 10.11

[mariadb]
name = MariaDB
baseurl = https://rpm.mariadb.org/10.11/centos/$releasever/$basearch
module_hotfixes = 1
gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck = 1


After that we’ll install Mariadb 10.11 :

yum clean all
yum install MariaDB-server MariaDB-client net-snmp perl-DBD-MySQL -y
yum update -y


To upgrade Mariadb 10.11 in Centos 8 stream/almalinux 8/rockylinux 8 do this :
Now edit/create the Repo file :

Ensure you don’t have any other MariaDB repo file in /etc/yum.repos.d if exists delete or backup the existing repo file :

mv /etc/yum.repos.d/mariadb.repo /etc/yum.repos.d/mariadb.repo.bak
nano /etc/yum.repos.d/mariadb.repo


add this lines and save it :

[mariadb]
name = MariaDB
baseurl = https://rpm.mariadb.org/10.11/centos/$releasever/$basearch
module_hotfixes = 1
gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck = 1


After that update Mariadb 10.11 :

yum clean all
yum install MariaDB-server MariaDB-client net-snmp perl-DBD-MySQL -y
yum update -y


Step 3 :
Restore the my.cnf file :

rm -rf /etc/my.cnf
cp /etc/my.cnf.bak /etc/my.cnf


Then enable mariadb to start on boot and start the service :

systemctl enable mariadb
service mariadb start


Step 4 :
After Installation we need to upgrade current databases by this command :

mysql_upgrade --force


that’s it you’ve successfully upgraded MariaDB 10.0/10.1/10.2/10.3/10.xx to MariaDB 10.11.

You can confirm the version by running this command from terminal ssh:

mysql -V

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Every thing seems to be running OK following the above in AlmaLinux 8.9

There is one thing: mysql_upgrade --force works but it produces the following error ---> "mysql_upgrade: unknown variable 'query_cache_type=1'"

In CWP dashboard using the restart MySQL Database Server button works, and the error is suppressed in the success dialogue. 

Thanks for sharing this with us Sandeep! 

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

Tried this on one of my servers and the upgrade went smoothly but monit monitoring doesn't seem to pick it up.

I always get :

Process - mysql Execution failed | Does not exist

reloading / restarting / unmonitor and remonitor didn't help.

Maybe we need to update the contents of File: /etc/monit.d/cwp.mysql  somehow ?

 

Link to comment
Share on other sites

add this line to /etc/my.cnf 

[mysqld]
pid-file = /var/lib/mysql/mariadb.pid

restart mariadb service

and edit monit config file

nano /etc/monit.d/cwp.mysql

replace with below config

check process mariadb with pidfile /var/lib/mysql/mariadb.pid
  group database
  start program = "/usr/bin/systemctl start mariadb"
  stop  program = "/usr/bin/systemctl stop mariadb"
  restart program  = "/usr/bin/systemctl restart mariadb"
  if failed port 3306 protocol mysql then restart
  if 3 restarts within 5 cycles then timeout
  alert root@localhost only on {timeout}

then restart monit service 

Link to comment
Share on other sites

35 minutes ago, Sandeep B. said:

add this line to /etc/my.cnf 

[mysqld]
pid-file = /var/lib/mysql/mariadb.pid

restart mariadb service

and edit monit config file

nano /etc/monit.d/cwp.mysql

replace with below config

check process mariadb with pidfile /var/lib/mysql/mariadb.pid
  group database
  start program = "/usr/bin/systemctl start mariadb"
  stop  program = "/usr/bin/systemctl stop mariadb"
  restart program  = "/usr/bin/systemctl restart mariadb"
  if failed port 3306 protocol mysql then restart
  if 3 restarts within 5 cycles then timeout
  depends on mariadb_bin
  depends on mariadb_init
  alert root@localhost only on {timeout}

then restart monit service 

Now monit won't start at all.

running sudo monit -t

get this
 

Depending service 'mariadb_init' is not defined in the control file

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...