lunes, 21 de junio de 2021

MariaDB 5.5.68 Upgrade to 10.4

First step BACKUP.
# mysqldump -u root -p --all-databases --routines --triggers > /tmp/all-databases.sql
# cp /etc/my.cnf /etc/my.cnf.orig

Validate version:
# mysql -V

Update and reboot...
# yum update -y
# reboot

Stop services: 
# systemctl stop mariadb

Remove mariadb-server / mariadb.
# yum remove mariadb mariadb-server

Install nano editor but you can use vi / vim / etc....

# yum install nano epel-release

Create or edit the repo file.
# nano /etc/yum.repos.d/mariadb.repo

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Clean repos...
# yum clean all

Install MariaDB / Client 10.4
# yum install MariaDB-server MariaDB-client net-snmp perl-DB-MySQL -y

Restore my.cnf (if required ... sometimes it is not ...)
# rm -rf /etc/my.cnf
# cp /etc/my.cnf.orig /etc/my.cnf

Enable services:
# systemctl enable mariadb
# systemctl start mariadb

Upgrade databases:
# mysql_upgrade

If you receive this error:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

# mysql_ugprade --password

Validate version:
# mysql -V

1 comentario:

  1. Thank You. Do MariaDB 10.x has the same problems as MySQL 5.7 with STRICT mode and have to be mitigated with sql_mode in config file?

    I genrally found that it's easier to migrate MySQL 5.5 -> MariaDB 10.4/10.5, than to MySQL 5.7/8.0.

    ResponderEliminar