Yes Hi everyone
This article is for me and you who continue to use CentOS 6.7 stubbornly.
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.
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.
# 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
# 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.
---
# 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)
I hope it will be helpful for those who are still working hard on CentOS 6 series.
**Thank you very much. ** **
Recommended Posts