Upgrade from MYSQL5.7 to 8.0 on CentOS 6.7

Talk about upgrading from MYSQL 5.7 to 8.0 on CentOS 6.7

Yes Hi everyone

This article is for me and you who continue to use CentOS 6.7 stubbornly.

Details

Referenced site https://blog.offline-net.com/2018/04/22/upgrade_from_mysql_57_to_80/ https://qiita.com/imunew/items/3810a41960f40db85c94 https://ksm.bf1.jp/?p=216

environment: CentOS6.7 MYSQL5.7 MYSQL8.0

Notes: CentOS6 is no longer supported on 2020-11-30. Still for those who want to use it.

First of all, yum cannot be used

I can't connect to the YUM URL because support has ended. So you need to change it to an alternative URL.

# sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
# sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo

Now you can use yum.

Uninstall MYSQL5.7

# cat /etc/redhat-release
CentOS release 6.7 (Final)
# mysql --version
mysql  Ver 14.14 Distrib 5.7.32, for Linux (x86_64) using  EditLine wrapper
# cat /etc/my.cnf

# rpm -qa |grep community-release
mysql57-community-release-el6-7.noarch

# rpm -e mysql57-community-release

Install MYSQL 8.0

# wget https://dev.mysql.com/get/mysql80-community-release-el6-3.noarch.rpm
# rpm -ivh mysql80-community-release-el6-3.noarch.rpm
# yum --showduplicates search mysql-community-server
mysql-community-server-8.0.22-1.el6.x86_64
Assume that ↑ is the latest version.

# /etc/init.d/mysqld stop
# grep datadir /etc/my.cnf
datadir=/var/lib/mysql
Suppose.
# cp -aR /var/lib/mysql/ /var/lib/mysql_bk/
* If there is free space, make a backup.
# yum update mysql-server

# vi /etc/my.cnf
1.query_cache_*Comment out the parameters of
2.[mysqld]Put the following options in default_authentication_plugin=mysql_native_password
# cat /etc/my.cnf

# cat /etc/init.d/mysqld|grep /mysqld | grep action
Check the location of mysqld "/usr/sbin/Suppose it was "mysqld".

# /usr/sbin/mysqld --basedir=/usr --user=mysql --upgrade=FORCE
⇒The terminal does not come back while it is being processed.

Raise another terminal

# tail -f /var/log/mysqld.log
OK if this log appears
2020-12-16T03:02:18.203596Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.22'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server - GPL.
---
2020-12-16T03:05:35.865223Z 0 [ERROR] [MY-010901] [Server] Can't open shared library '/var/lib/mysql/lib64/mysql/plugin/validate_password.so' (errno: 0 /var/lib/mysql/lib64/mysql/plugin/validate_password.so: cannot open shared object file: No such file or directory).
⇒ If you get such an error, search for the file below
# find / -name "validate_password.so"
/usr/lib64/mysql/plugin/validate_password.so
/usr/lib64/mysql/plugin/debug/validate_password.so
* In this case, before lib64--basedir=/usr is the correct option.
Stop and re-execute with the kill command in the next step.
---

Confirmation of upgrade completion

# ps -ef |grep FORCE
# kill -9 {↑ PID}
The terminal being upgraded is displayed as forced to terminate

# service mysqld restart
# mysql -u root -p
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.22    |
+-----------+
mysql> quit
---
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
If you get this error
/etc/my.Put the following in cnf and restart MYSQLD
[client]
socket=/var/lib/mysql/mysql.sock
---

# mysql --version
mysql  Ver 8.0.22 for Linux on x86_64 (MySQL Community Server - GPL)

Impressions

I hope it will be helpful for those who are still working hard on CentOS 6 series.

**Thank you very much. ** **

Recommended Posts

Upgrade from MYSQL5.7 to 8.0 on CentOS 6.7
Steps to install MySQL 8 on CentOS 8
To connect from Spring to MySQL on virtual server (unsolved)
Measures to prevent MySQL/MariaDB process from crashing on CentOS7
Install MySQL 5.6 on CentOS6 [How to specify the version]
[Ruby on Rails] From MySQL construction to database change
How to deploy Laravel on CentOS 7
Ubuntu Desktop upgrade from 18.0.4 (?) To 20.04.1 (focal)
How to install MariaDB 10.4 on CentOS 8
Install apache 2.4.46 from source on CentOS7
Change DB from SQLite to MySQL
Notes on migrating from CircleCI 1.0 to 2.0
Upgrade spring boot from 1.5 series to 2.0 series
Steps to install devtoolset-6 on CentOS 7
Update MySQL from 5.7 to 8.0 with Docker
I tried upgrading from CentOS 6.5 to CentOS 7 with the upgrade tool
Steps to install samba on CentOS 8 and connect from Windows 10 Explorer
Install samba4 from source code on CentOS8
Introducing Pacemaker from CentOS 7 repository to RHEL7
How to install beta php8.0 on CentOS8
Connect from Java to MySQL using Eclipse
I tried to build AdoptOpenjdk 11 on CentOS 7
OpenVPN on CentOS 8
Command to install nginx / PHP7 / php-fpm on CentOS7
Migration from Eclipse to IntelliJ (on the way)
Connect to Aurora (MySQL) from a Java application
Procedure to change lower_case_table_names = 1 in MySQL 8.0 of CentOS 8.3
Note how to rollback Mysql deployed on Heroku
[Rails MySQL] How to reset DB on heroku
DataSource connection from WebSphere to MySQL (DataSource property change?)
Maven on CentOS 7 tutorial
Changes from Java 8 to Java 11
Sum from Java_1 to 100
Migrate from JUnit 4 to JUnit 5
Install Golang on CentOS 8
Install Neo4j 4.1.3 on centOS
Tomcat v8 on CentOS7
List how to learn from Docker to AKS on AWS
[Java] Connect to MySQL
[Updated from time to time] Ruby on Rails Convenient methods
Install Vertica 10.0 on CentOS 6.10
Zabbix 5 installation on CentOS 8
Install the latest hardware drivers from ELRepo on CentOS
Steps to set up Postfix and Dovecot on CentOS 8.3
How to connect to ClearDB from Sequel Pro on Heroku
Install PostgreSQL 12 on Centos8
Install nginx on centOS7
Steps to set up a VNC server on CentOS 8.3
Install Python 3 on CentOS 7
Install kuromoji on CentOS7
From Java to Ruby !!
Use bat on Centos.
Jetty v8 on CentOS7
OpenJDK installation on CentOS 7
Install Mattermost on CentOS 7
Install PostGIS 2.5.5 on CentOS7
Install jpndistrict on CentOS 7
[Ruby on rails + Mysql] Data migration procedure memo when switching from heroku to AWS
How to install MySQL
Introduced view customization plugin to Redmine installed on CentOS8
CentOS 7 curl version upgrade