이번 글에는 마이너 업그레이드를 해보고 정리한 글입니다.
이전 글을 참고하여 마이너업그레이드에 대한 정보를 확인하세요.
간단히 말하면 같은 버전에서의 업그레이드입니다. (5.7xx -> 5.7.yy)
이전글
https://bae9086.tistory.com/504
OS : CentOS Linux release 7.9.2009 (Core)
AS - IS DB 버전 : MySQL 5.7.25
To -be DB버전 : MySQL 5.7.43
마이너 업그레이드는 제가 테스트 하고도 이게 맞나 싶을정도로 간단했습니다.
같은 버전이기 때문에 내부적인 딕셔너리 변경도 없었습니다.
기존 설치를 rpm으로 기본디렉토리에 설치했었기 때문에 업그레이드도 rpm으로 설치를 진행하였습니다.
순서는
1)기존 DB down
2)기존 DB rpm 삭제
3) 새 DB rpm 설치
4) DB start
입니다.
순서 전에 백업 및 테스트 데이터를 넣고 진행해보겠습니다.
0) 테스트 데이터 삽입 및 백업
mysql> create database ysbae;
Query OK, 1 row affected (0.01 sec)
mysql> create table ysbae.mig_test(a int);
Query OK, 0 rows affected (0.01 sec)
mysql> insert into ysbae.mig_test values(231024);
Query OK, 1 row affected (0.01 sec)
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from ysbae.mig_test;
+--------+
| a |
+--------+
| 231024 |
| 231024 |
+--------+
2 rows in set (0.00 sec)
백업
[root@ysbae ~]# mysqldump --user=root -p -A > mysqldump_20231024_manual_backup.sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
[root@ysbae ~]# ls
anaconda-ks.cfg mysqldump_20231024_manual_backup.sql
1)버전확인 및 기존 DB down
버전확인 5.7.25버전인것을 확인
# mysql --version
mysql Ver 14.14 Distrib 5.7.25, for Linux (x86_64) using EditLine wrapper
# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.7.25 MySQL Community Server (GPL)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
...
기존 DB down
# systemctl stop mysqld
2)기존 DB rpm 삭제
# rpm -qa |grep mysql
mysql-community-libs-5.7.25-1.el7.x86_64
mysql-community-common-5.7.25-1.el7.x86_64
mysql-community-server-5.7.25-1.el7.x86_64
mysql-community-client-5.7.25-1.el7.x86_64
#rpm -e mysql-community-libs-5.7.25-1.el7.x86_64
#rpm -e mysql-community-common-5.7.25-1.el7.x86_64
#rpm -e mysql-community-server-5.7.25-1.el7.x86_64
#rpm -e mysql-community-client-5.7.25-1.el7.x86_64
3)새로운 rpm 설치
다운로드 url
https://dev.mysql.com/downloads/mysql/5.7.html
압축풀기
# tar xvf mysql-5.7.43-1.el7.x86_64.rpm-bundle.tar
mysql-community-client-5.7.43-1.el7.x86_64.rpm
mysql-community-common-5.7.43-1.el7.x86_64.rpm
mysql-community-devel-5.7.43-1.el7.x86_64.rpm
mysql-community-embedded-5.7.43-1.el7.x86_64.rpm
mysql-community-embedded-compat-5.7.43-1.el7.x86_64.rpm
mysql-community-embedded-devel-5.7.43-1.el7.x86_64.rpm
mysql-community-libs-5.7.43-1.el7.x86_64.rpm
mysql-community-libs-compat-5.7.43-1.el7.x86_64.rpm
mysql-community-server-5.7.43-1.el7.x86_64.rpm
mysql-community-test-5.7.43-1.el7.x86_64.rpm
rpm 설치
# rpm -ivh mysql-community-common-5.7.43-1.el7.x86_64.rpm
경고: mysql-community-common-5.7.43-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
준비 중... ################################# [100%]
Updating / installing...
1:mysql-community-common-5.7.43-1.e################################# [100%]
# rpm -ivh mysql-community-libs-5.7.43-1.el7.x86_64.rpm
경고: mysql-community-libs-5.7.43-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
준비 중... ################################# [100%]
Updating / installing...
1:mysql-community-libs-5.7.43-1.el7################################# [100%]
# rpm -ivh mysql-community-client-5.7.43-1.el7.x86_64.rpm
경고: mysql-community-client-5.7.43-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
준비 중... ################################# [100%]
Updating / installing...
1:mysql-community-client-5.7.43-1.e################################# [100%]
# rpm -ivh mysql-community-server-5.7.43-1.el7.x86_64.rpm
경고: mysql-community-server-5.7.43-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
준비 중... ################################# [100%]
Updating / installing...
1:mysql-community-server-5.7.43-1.e################################# [100%]
4)DB start
# systemctl start mysqld
# systemctl status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since 화 2023-10-24 11:14:08 KST; 5s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 4493 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
Process: 4476 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 4496 (mysqld)
CGroup: /system.slice/mysqld.service
└─4496 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
버전확인
5.7.43버전인 것을 확인 할 수 있습니다.
# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.43 MySQL Community Server (GPL)
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| ysbae |
+--------------------+
5 rows in set (0.01 sec)
mysql> select * from ysbae.mig_test;
+--------+
| a |
+--------+
| 231024 |
| 231024 |
+--------+
2 rows in set (0.01 sec)
# mysql --version
mysql Ver 14.14 Distrib 5.7.43, for Linux (x86_64) using EditLine wrapper
데이터 디렉토리는 그대로 두고 하는 업그레이드 이기 때문에 간단하게 끝났던거 같습니다.
다음에는 5.7 -> 8.x인 메이저 업그레이드를 테스트 후에 정리하도록 하겠습니다.
'다른 DBMS > MySQL&MariaDB' 카테고리의 다른 글
[Warnings]Integer display width is deprecated and will be removed in a future release. (0) | 2023.11.10 |
---|---|
[Client 접속에러] Unblock with 'mysqladmin flush-hosts' (0) | 2023.10.30 |
[Mysql Workbench]접속 에러 해결 : unsupported protocol (2) | 2023.10.23 |
변수를 적용하는 새로운 방법 - SET PERSIST (0) | 2023.10.18 |
MySQL의 업그레이드 (1) (0) | 2023.08.24 |
댓글