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