mariadb 버전 업그레이드# DataBase/Mysql(MariaDB)2022. 7. 19. 07:48
Table of Contents
728x90
반응형
메이저 버전이던 마이너버전이던 둘다 동일
1. mariadb 버전확인
[darksharavim.tistory.com]mysql -V
mysql Ver 15.1 Distrib 10.3.35-MariaDB, for Linux (x86_64) using readline 5.1
2. innodb_fast_shutdown을 0으로 설정
[darksharavim.tistory.com]mysql -u root -p --execute="SET GLOBAL innodb_fast_shutdown=0"
Enter password:
[darksharavim.tistory.com]
https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_fast_shutdown
3. 전체 데이터베이스 백업
[darksharavim.tistory.com]mysqldump -uroot -p --all-databases --lock-all-tables | gzip -c > dbdump.zip
Enter password:
[darksharavim.tistory.com]
--lock-all-tables 옵션을 넣지 않을시 아래와 같이 에러발생할수 있음.
mysqldump: Got error: 1556: "You can't use locks with log tables" when using LOCK TABLES
4. 서비스 중지
[darksharavim.tistory.com]systemctl stop mariadb
5. 기존 mariadb삭제
[darksharavim.tistory.com]yum -y remove MariaDB*
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-client.x86_64 0:10.3.35-1.el7.centos will be erased
---> Package MariaDB-common.x86_64 0:10.3.35-1.el7.centos will be erased
---> Package MariaDB-compat.x86_64 0:10.3.35-1.el7.centos will be erased
---> Package MariaDB-server.x86_64 0:10.3.35-1.el7.centos will be erased
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Removing:
MariaDB-client x86_64 10.3.35-1.el7.centos @mariadb 58 M
MariaDB-common x86_64 10.3.35-1.el7.centos @mariadb 303 k
MariaDB-compat x86_64 10.3.35-1.el7.centos @mariadb 11 M
MariaDB-server x86_64 10.3.35-1.el7.centos @mariadb 121 M
Transaction Summary
========================================================================================================================================================================
Remove 4 Packages
Installed size: 191 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : MariaDB-server-10.3.35-1.el7.centos.x86_64 1/4
경고: /etc/my.cnf.d/server.cnf(이)가 /etc/my.cnf.d/server.cnf.rpmsave(으)로 저장되었습니다
Erasing : MariaDB-client-10.3.35-1.el7.centos.x86_64 2/4
Erasing : MariaDB-compat-10.3.35-1.el7.centos.x86_64 3/4
Erasing : MariaDB-common-10.3.35-1.el7.centos.x86_64 4/4
Verifying : MariaDB-client-10.3.35-1.el7.centos.x86_64 1/4
Verifying : MariaDB-server-10.3.35-1.el7.centos.x86_64 2/4
Verifying : MariaDB-compat-10.3.35-1.el7.centos.x86_64 3/4
Verifying : MariaDB-common-10.3.35-1.el7.centos.x86_64 4/4
Removed:
MariaDB-client.x86_64 0:10.3.35-1.el7.centos MariaDB-common.x86_64 0:10.3.35-1.el7.centos MariaDB-compat.x86_64 0:10.3.35-1.el7.centos
MariaDB-server.x86_64 0:10.3.35-1.el7.centos
Complete!
6. 새로운 버전 mariadb.repo로 수정(10.3버전이면 10.6로 수정)
[darksharavim.tistory.com]vi /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.3 CentOS repository list - created 2022-07-19 00:13 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
baseurl = https://tw1.mirror.blendbyte.net/mariadb/yum/10.6/centos7-amd64
gpgkey=https://tw1.mirror.blendbyte.net/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
7. 설치 및 my.cnf복원
[darksharavim.tistory.com]yum -y install MariaDB
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* base: mirror.kakao.com
* epel: ftp.iij.ad.jp
* extras: mirror.kakao.com
* updates: mirror.kakao.com
mariadb | 3.4 kB 00:00:00
(1/2): mariadb/updateinfo | 5.5 kB 00:00:00
(2/2): mariadb/primary_db | 70 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-server.x86_64 0:10.6.8-1.el7.centos will be installed
--> Processing Dependency: MariaDB-common >= 10.6.1 for package: MariaDB-server-10.6.8-1.el7.centos.x86_64
--> Processing Dependency: MariaDB-client >= 10.6.1 for package: MariaDB-server-10.6.8-1.el7.centos.x86_64
--> Processing Dependency: libpmem.so.1(LIBPMEM_1.0)(64bit) for package: MariaDB-server-10.6.8-1.el7.centos.x86_64
--> Processing Dependency: galera-4 for package: MariaDB-server-10.6.8-1.el7.centos.x86_64
--> Processing Dependency: libpmem.so.1()(64bit) for package: MariaDB-server-10.6.8-1.el7.centos.x86_64
--> Running transaction check
---> Package MariaDB-client.x86_64 0:10.6.8-1.el7.centos will be installed
---> Package MariaDB-common.x86_64 0:10.6.8-1.el7.centos will be installed
--> Processing Dependency: MariaDB-compat for package: MariaDB-common-10.6.8-1.el7.centos.x86_64
---> Package galera.x86_64 0:25.3.35-1.el7.centos will be obsoleted
---> Package galera-4.x86_64 0:26.4.11-1.el7.centos will be obsoleting
--> Processing Dependency: socat for package: galera-4-26.4.11-1.el7.centos.x86_64
---> Package libpmem.x86_64 0:1.5.1-2.1.el7 will be installed
--> Running transaction check
---> Package MariaDB-compat.x86_64 0:10.6.8-1.el7.centos will be installed
---> Package socat.x86_64 0:1.7.3.2-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
MariaDB-server x86_64 10.6.8-1.el7.centos mariadb 25 M
galera-4 x86_64 26.4.11-1.el7.centos mariadb 9.9 M
replacing galera.x86_64 25.3.35-1.el7.centos
Installing for dependencies:
MariaDB-client x86_64 10.6.8-1.el7.centos mariadb 14 M
MariaDB-common x86_64 10.6.8-1.el7.centos mariadb 81 k
MariaDB-compat x86_64 10.6.8-1.el7.centos mariadb 2.2 M
libpmem x86_64 1.5.1-2.1.el7 base 59 k
socat x86_64 1.7.3.2-2.el7 base 290 k
Transaction Summary
========================================================================================================================================================================
Install 2 Packages (+5 Dependent packages)
Total download size: 52 M
Downloading packages:
(1/7): MariaDB-common-10.6.8-1.el7.centos.x86_64.rpm | 81 kB 00:00:00
(2/7): MariaDB-compat-10.6.8-1.el7.centos.x86_64.rpm | 2.2 MB 00:00:00
(3/7): MariaDB-client-10.6.8-1.el7.centos.x86_64.rpm | 14 MB 00:00:03
(4/7): socat-1.7.3.2-2.el7.x86_64.rpm | 290 kB 00:00:00
(5/7): libpmem-1.5.1-2.1.el7.x86_64.rpm | 59 kB 00:00:00
(6/7): galera-4-26.4.11-1.el7.centos.x86_64.rpm | 9.9 MB 00:00:02
(7/7): MariaDB-server-10.6.8-1.el7.centos.x86_64.rpm | 25 MB 00:00:05
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 7.3 MB/s | 52 MB 00:00:07
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : MariaDB-compat-10.6.8-1.el7.centos.x86_64 1/8
Installing : MariaDB-common-10.6.8-1.el7.centos.x86_64 2/8
Installing : libpmem-1.5.1-2.1.el7.x86_64 3/8
Installing : MariaDB-client-10.6.8-1.el7.centos.x86_64 4/8
Installing : socat-1.7.3.2-2.el7.x86_64 5/8
Installing : galera-4-26.4.11-1.el7.centos.x86_64 6/8
Installing : MariaDB-server-10.6.8-1.el7.centos.x86_64 7/8
Erasing : galera-25.3.35-1.el7.centos.x86_64 8/8
Verifying : galera-4-26.4.11-1.el7.centos.x86_64 1/8
Verifying : MariaDB-server-10.6.8-1.el7.centos.x86_64 2/8
Verifying : MariaDB-common-10.6.8-1.el7.centos.x86_64 3/8
Verifying : MariaDB-compat-10.6.8-1.el7.centos.x86_64 4/8
Verifying : socat-1.7.3.2-2.el7.x86_64 5/8
Verifying : MariaDB-client-10.6.8-1.el7.centos.x86_64 6/8
Verifying : libpmem-1.5.1-2.1.el7.x86_64 7/8
Verifying : galera-25.3.35-1.el7.centos.x86_64 8/8
Installed:
MariaDB-server.x86_64 0:10.6.8-1.el7.centos galera-4.x86_64 0:26.4.11-1.el7.centos
Dependency Installed:
MariaDB-client.x86_64 0:10.6.8-1.el7.centos MariaDB-common.x86_64 0:10.6.8-1.el7.centos MariaDB-compat.x86_64 0:10.6.8-1.el7.centos libpmem.x86_64 0:1.5.1-2.1.el7
socat.x86_64 0:1.7.3.2-2.el7
Replaced:
galera.x86_64 0:25.3.35-1.el7.centos
Complete!
[darksharavim.tistory.com]rpm -qa | grep -i mariadb
MariaDB-common-10.6.8-1.el7.centos.x86_64
MariaDB-server-10.6.8-1.el7.centos.x86_64
MariaDB-client-10.6.8-1.el7.centos.x86_64
MariaDB-compat-10.6.8-1.el7.centos.x86_64
[darksharavim.tistory.com]cd /etc/my.cnf.d/
[darksharavim.tistory.com]mv server.cnf.rpmsave server.cnf
mv: overwrite `server.cnf'? y
[darksharavim.tistory.com]
8. 서비스 구동
[darksharavim.tistory.com]systemctl start mariadb
9. 업그레이드
[darksharavim.tistory.com]mysql_upgrade -u root -p
Enter password:
Major version upgrade detected from 10.3.35-MariaDB to 10.6.8-MariaDB. Check required!
Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
mysql.servers OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.transaction_registry OK
mysql.user OK
Phase 2/7: Installing used storage engines... Skipped
Phase 3/7: Fixing views
Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/7: Fixing table and database names
Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
performance_schema
..
..
sys
sys.sys_config OK
Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
[darksharavim.tistory.com]
10. 서비스 재기동
[darksharavim.tistory.com]systemctl restart mariadb
11. 확인
[darksharavim.tistory.com]mysql -V
mysql Ver 15.1 Distrib 10.6.8-MariaDB, for Linux (x86_64) using readline 5.1
[darksharavim.tistory.com]mysql -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 33
Server version: 10.6.8-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
백업 데이터베이스 복원
https://blog.servis.co.kr/index.php/2020/03/25/mariadb-upgrade/
mariadb EOS확인
https://endoflife.date/mariadb
728x90
반응형
'# DataBase > Mysql(MariaDB)' 카테고리의 다른 글
[mysql]특정DB 전체 테이블 삭제 (0) | 2022.10.11 |
---|---|
[mysql]innodb 메모리별 설정값 예시 (0) | 2022.09.29 |
mariadb 특정 버전 지정 설치 (0) | 2022.07.19 |
mysql ssl 설정 및 적용 (0) | 2022.05.03 |
mysql 현재 기준 한달이전 확인 쿼리 (0) | 2022.04.28 |
@다크쉐라빔 :: 다크쉐라빔의 주절주절
안녕하세요. 이곳은 IT위주의 잡다한 정보를 올려두는 개인 블로그입니다.
포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!