https://teguhth.blogspot.com/2023/06/upgrading-from-mariadb-104-to-mariadb.html
1. check Repo for prepare maria 12x
[root@teguhth-all /]# cat /etc/yum.repos.d/mariadb.repo
[mariadb-main]
name = MariaDB Server
#baseurl = https://dlm.mariadb.com/repo/mariadb-server/11/yum/rhel/9/x86_64
baseurl = https://dlm.mariadb.com/repo/mariadb-server/12.rolling/yum/rhel/9/x86_64
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-Server-GPG-KEY
gpgcheck = 1
enabled = 1
module_hotfixes = 1
[mariadb-maxscale]
# To use the latest stable release of MaxScale, use "latest" as the version
# To use the latest beta (or stable if no current beta) release of MaxScale, use "beta" as the version
name = MariaDB MaxScale
baseurl = https://dlm.mariadb.com/repo/maxscale/latest/yum/rhel/9/x86_64
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-MaxScale-GPG-KEY
gpgcheck = 1
enabled = 1
[root@teguhth-all /]#
2. check rpm for existing
rpm -qa | grep -i '^mariadb'
[root@teguhth-all /]#
[root@teguhth-all /]# rpm -qa | grep -i '^mariadb'
MariaDB-shared-11.8.8-1.el9.x86_64
MariaDB-common-11.8.8-1.el9.x86_64
MariaDB-client-compat-11.8.8-1.el9.noarch
MariaDB-client-11.8.8-1.el9.x86_64
MariaDB-server-compat-11.8.8-1.el9.noarch
MariaDB-server-11.8.8-1.el9.x86_64
MariaDB-devel-11.8.8-1.el9.x86_64
[root@teguhth-all /]#
3. OS
grep '^PRETTY_NAME=' /etc/os-release | cut -d= -f2- | tr -d '"'
systemctl show -p Description --value mariadb
systemctl show -p Description --value mariadb | grep -oP 'MariaDB \K[0-9.]+' | sed 's/^/MariaDB /'
[root@teguhth-all /]# grep '^PRETTY_NAME=' /etc/os-release | cut -d= -f2- | tr -d '"'
Rocky Linux 9.8 (Blue Onyx)
[root@teguhth-all /]#
[root@teguhth-all /]# systemctl show -p Description --value mariadb
MariaDB 11.8.8 database server
[root@teguhth-all /]#
[root@teguhth-all /]# systemctl show -p Description --value mariadb | grep -oP 'MariaDB \K[0-9.]+' | sed 's/^/MariaDB /'
MariaDB 11.8.8
[root@teguhth-all /]#
4. check version before update
systemctl show -p Description --value mariadb
select @@hostname,@@version;
[root@teguhth-all /]# systemctl show -p Description --value mariadb
MariaDB 11.8.8 database server
[root@teguhth-all /]#
[root@teguhth-all /]# mariadb
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 11.8.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)]> select @@hostname,@@version;
+-------------+----------------+
| @@hostname | @@version |
+-------------+----------------+
| teguhth-all | 11.8.8-MariaDB |
+-------------+----------------+
1 row in set (0.003 sec)
MariaDB [(none)]>
5. backup server.cnf
cp /etc/my.cnf.d/server.cnf /data/server_backup.cnf
[root@teguhth-all /]# cp /etc/my.cnf.d/server.cnf /data/server_backup.cnf
[root@teguhth-all /]#
6. stop mariadb
[root@teguhth-all /]# systemctl stop mariadb
[root@teguhth-all /]#
7. uninstall mariadb 11.8
yum remove MariaDB-server MariaDB-client MariaDB-shared MariaDB-common -y
8. check rpm
rpm -qa | grep -i '^mariadb'
Complete!
[root@teguhth-all /]# rpm -qa | grep -i '^mariadb'
[root@teguhth-all /]#
9. clean update
yum clean all
[root@teguhth-all /]# yum clean all
139 files removed
[root@teguhth-all /]#
10. install mariadb 12
yum install MariaDB-server MariaDB-client MariaDB-shared MariaDB-common -y
11. get error (jika salah repo)
[root@teguhth-all /]# yum install MariaDB-server MariaDB-client MariaDB-shared MariaDB-common -y
Node.js Packages for Linux RPM based distros - x86_64 886 kB/s | 1.0 MB 00:01
N|Solid Packages for Linux RPM based distros - x86_64 247 kB/s | 719 kB 00:02
Extra Packages for Enterprise Linux 9 - x86_64 7.1 MB/s | 21 MB 00:02
Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64 103 B/s | 2.5 kB 00:24
MariaDB Server 116 kB/s | 819 kB 00:07
MariaDB MaxScale 1.8 kB/s | 6.9 kB 00:03
MongoDB Repository 46 kB/s | 67 kB 00:01
Microsoft Production 1.8 MB/s | 25 MB 00:13
PostgreSQL common RPMs for RHEL / Rocky Linux / AlmaLinux 9 - x86_64 674 kB/s | 899 kB 00:01
PostgreSQL 18 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64 1.9 MB/s | 717 kB 00:00
PostgreSQL 17 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64 2.0 MB/s | 1.2 MB 00:00
PostgreSQL 16 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64 2.7 MB/s | 1.5 MB 00:00
PostgreSQL 15 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64 3.9 MB/s | 1.7 MB 00:00
PostgreSQL 14 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64 1.4 MB/s | 2.0 MB 00:01
Rocky Linux 9 - BaseOS 2.9 MB/s | 16 MB 00:05
Rocky Linux 9 - AppStream 1.4 MB/s | 17 MB 00:12
Rocky Linux 9 - CRB 1.1 MB/s | 4.8 MB 00:04
Rocky Linux 9 - Extras 14 kB/s | 17 kB 00:01
RPM Fusion for EL 9 - Free - Updates 48 kB/s | 187 kB 00:03
RPM Fusion for EL 9 - Nonfree - Updates 43 kB/s | 124 kB 00:02
Error:
Problem 1: cannot install the best candidate for the job
- nothing provides libstdc++.so.6(CXXABI_1.3.15)(64bit) needed by MariaDB-server-12.3.2-1.el10.x86_64 from mariadb-main
- nothing provides libstdc++.so.6(GLIBCXX_3.4.30)(64bit) needed by MariaDB-server-12.3.2-1.el10.x86_64 from mariadb-main
- nothing provides libstdc++.so.6(GLIBCXX_3.4.32)(64bit) needed by MariaDB-server-12.3.2-1.el10.x86_64 from mariadb-main
Problem 2: cannot install the best candidate for the job
- nothing provides libstdc++.so.6(CXXABI_1.3.15)(64bit) needed by MariaDB-client-12.3.2-1.el10.x86_64 from mariadb-main
- nothing provides libstdc++.so.6(GLIBCXX_3.4.30)(64bit) needed by MariaDB-client-12.3.2-1.el10.x86_64 from mariadb-main
- nothing provides libstdc++.so.6(GLIBCXX_3.4.32)(64bit) needed by MariaDB-client-12.3.2-1.el10.x86_64 from mariadb-main
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
[root@teguhth-all /]#
12. copy backup old server.cnf
cp /etc/my.cnf.d/server.cnf.rpmsave /etc/my.cnf.d/server.cnf
[root@teguhth-all /]# cp /etc/my.cnf.d/server.cnf.rpmsave /etc/my.cnf.d/server.cnf
cp: overwrite '/etc/my.cnf.d/server.cnf'? y
[root@teguhth-all /]#
13. restart mariadb
systemctl enable mariadb
systemctl start mariadb
[root@teguhth-all /]# systemctl enable mariadb
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service ? /usr/lib/systemd/system/mariadb.service.
[root@teguhth-all /]#
[root@teguhth-all /]# systemctl start mariadb
[root@teguhth-all /]#
14. run mariadb upgrade
mariadb-upgrade -f
[root@teguhth-all /]# mariadb-upgrade -f
Phase 1/8: 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.global_priv OK
mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic 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
Phase 2/8: Installing used storage engines... Skipped
Phase 3/8: Running 'mysql_fix_privilege_tables'
Phase 4/8: Fixing views
dbone.v_pembelian OK
dbtwo.v_pembelian
Error : Table 'dbtwo.pembelian' doesn't exist
Error : View 'dbtwo.v_pembelian' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
error : Corrupt
teguhthdb
teguhthdb.barang OK
teguhthdb.customer OK
teguhthdb.pasok OK
teguhthdb.pembelian OK
teguhthdb.suplier OK
teguhthedb
teguhthedb.barang OK
teguhthedb.customer OK
teguhthedb.pasok OK
teguhthedb.pembelian OK
teguhthedb.suplier OK
teguhthoracle
teguhthoracle.barang OK
teguhthoracle.customer OK
teguhthoracle.pasok OK
teguhthoracle.pembelian OK
teguhthoracle.suplier OK
teguhthsql
teguhthsql.barang OK
teguhthsql.customer OK
teguhthsql.pasok OK
teguhthsql.pembelian OK
teguhthsql.suplier OK
test
Repairing tables
teguhth.pembelian
Error : Table `teguhth`.`pembelian` is corrupted. Please drop the table and recreate.
error : Corrupt
Phase 7/8: uninstalling plugins
Phase 8/8: Running 'FLUSH PRIVILEGES'
OK
[root@teguhth-all /]#
15. check rpm for existing
[root@teguhth-all /]# rpm -qa | grep -i '^mariadb'
MariaDB-shared-12.3.2-1.el9.x86_64
MariaDB-common-12.3.2-1.el9.x86_64
MariaDB-client-compat-12.3.2-1.el9.noarch
MariaDB-client-12.3.2-1.el9.x86_64
MariaDB-server-compat-12.3.2-1.el9.noarch
MariaDB-server-12.3.2-1.el9.x86_64
[root@teguhth-all /]#
16. check version before update
systemctl show -p Description --value mariadb
select @@hostname,@@version;
17. disable access ssl
[root@teguhth-all /]#
[root@teguhth-all /]# cat /etc/my.cnf.d/client.cnf
[client]
ssl=0
[root@teguhth-all /]#




No comments:
Post a Comment