Langsung ke konten utama

Upgrade to MariaDB Community Server 10.5 on CentOS 7

 https://mariadb.com/docs/operations/upgrades/upgrade-community-server-cs10-5-centos7/

Upgrade to MariaDB Community Server 10.5 on CentOS 7

Overview

These instructions detail the upgrade from a previous version of MariaDB Community Server to MariaDB Community Server 10.5 on CentOS Linux 7.

When MariaDB Community Server is upgraded, the old version needs to be uninstalled, and the new version needs to be installed.

Data Backup

Occasionally, issues can be encountered during upgrades. These issues can even potentially corrupt the database's data files, preventing you from easily reverting to the old installation. Therefore, it is generally best to perform a backup prior to upgrading. If an issue is encountered during the upgrade, you can use the backup to restore your MariaDB Server database to the old version. If the upgrade finishes without issue, then the backup can be deleted.

The instructions below show how to perform a backup using MariaDB Backup. For more information about backing up and restoring the database, please see the Recovery Guide.

  1. Take a full backup:

    $ sudo mariadb-backup --backup \
          --user=mariabackup_user \
          --password=mariabackup_passwd \
          --target-dir=/data/backup/preupgrade_backup
    

    Confirm successful completion of the backup operation.

  2. The backup must be prepared:

    $ sudo mariadb-backup --prepare \
          --target-dir=/data/backup/preupgrade_backup
    

    Confirm successful completion of the prepare operation.

  3. Backups should be tested before they are trusted.

Uninstall the Old Version

When upgrading to a new major release of MariaDB Community Server, it is necessary to remove the existing installation of MariaDB Community Server, before installing the new version of MariaDB Community Server. Otherwise, the package manager will refuse to install the new version of MariaDB Community Server.

Stop the MariaDB Server Process

Before the old version can be uninstalled, we first need to stop the current MariaDB Server process.

  1. Set the innodb_fast_shutdown system variable to 1:

    SET GLOBAL innodb_fast_shutdown = 1;
    
  2. Use XA RECOVER to confirm that there are no external XA transactions in a prepared state:

    XA RECOVER;
    

    Commit or rollback any open XA transactions before stopping the node for upgrade.

  3. Stop the server process using the systemctl command:

    $ sudo systemctl stop mariadb
    

Uninstall via YUM (RHEL/CentOS)

  1. Uninstall all of the MariaDB Community Server packages. Note that a wildcard character is used to ensure that all MariaDB Community Server packages are uninstalled:

    $ sudo yum remove "MariaDB-*"
    

    Be sure to check that this wildcard does not unintentionally refer to any of your custom applications:

  2. Uninstall the Galera package as well.

    The name of the package depends on the specific version of MariaDB Community Server.

    When upgrading from MariaDB Community Server 10.4 or later, the package is called galera-4:

    $ sudo yum remove galera-4
    

    When upgrading from MariaDB Community Server 10.3 or earlier, the package is called galera:

    $ sudo yum remove galera
    
  3. Before proceeding, verify that all MariaDB Community Server packages are uninstalled. The following command should not return any results:

    $ rpm --query --all | grep -i -E "mariadb|galera"
    

Install the New Version

MariaDB Corporation provides a YUM package repository for CentOS Linux 7.

Install via YUM (RHEL/CentOS)

  1. Configure the YUM package repository.

    To configure YUM package repositories:

    $ sudo yum install wget
    
    $ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
    
    $ echo "c330d2755e18e48c3bba300a2898b0fc8ad2d3326d50b64e02fe65c67b454599 mariadb_repo_setup" \
        | sha256sum -c -
    
    $ chmod +x mariadb_repo_setup
    
    $ sudo ./mariadb_repo_setup \
       --mariadb-server-version="mariadb-10.5"
    
  2. Install MariaDB Community Server and package dependencies:

    $ sudo yum install MariaDB-server MariaDB-backup
    

    Installation of additional packages may be required for some plugins.

  3. Configure MariaDB.

    Installation only loads MariaDB Community Server to the system. MariaDB Community Server requires configuration before the database server is ready for use.

Configuration

For platforms that use YUM or ZYpp as a package manager:

MariaDB Community Server's packages bundle several configuration files:

  • /etc/my.cnf

  • /etc/my.cnf.d/client.cnf

  • /etc/my.cnf.d/mysql-clients.cnf

  • /etc/my.cnf.d/server.cnf

If your version of any of these configuration files contained any custom edits, then the package manager may save your edited version with the .rpmsave extension during the upgrade process. If you want to continue using your version with the custom edits, then you may need to move it back. For example, to move server.cnf back in place:

$ sudo mv /etc/my.cnf.d/server.cnf /etc/my.cnf.d/server.cnf.original
$ sudo mv /etc/my.cnf.d/server.cnf.rpmsave /etc/my.cnf.d/server.cnf

Starting the Server

MariaDB Community Server includes configuration to start, stop, restart, enable/disable on boot, and check the status of the Server using the operating system default process management system.

CentOS Linux 7 uses systemd. You can manage the Server process using the systemctl command:

Operation

Command

Start

sudo systemctl start mariadb

Stop

sudo systemctl stop mariadb

Restart

sudo systemctl restart mariadb

Enable during startup

sudo systemctl enable mariadb

Disable during startup

sudo systemctl disable mariadb

Status

sudo systemctl status mariadb

Upgrading the Data Directory

MariaDB Community Server 10.5 ships with the mariadb-upgrade utility which can be used to identify and correct compatibility issues in the new version. After you upgrade your Server and start the server process, run this utility to upgrade the data directory:

$ sudo mariadb-upgrade

Testing

When MariaDB Community Server is up and running on your system, you should test that it is working and there weren't any issues during startup.

  1. Connect to the server using MariaDB Client using the root@localhost user account:

    $ sudo mariadb
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 9
    Server version: 10.5.13-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)]>
    

    The version of the server can be verified by checking the client's initial output.

  2. You can also verify the server version by checking the value of the version system variable with the SHOW GLOBAL STATUS statement:

    SHOW GLOBAL VARIABLES LIKE 'version';
    
    +---------------+-----------------+
    | Variable_name | Value           |
    +---------------+-----------------+
    | version       | 10.5.13-MariaDB |
    +---------------+-----------------+
    
  3. You can also verify the server version by calling the VERSION() function:

    SELECT VERSION();
    
    +-----------------+
    | VERSION()       |
    +-----------------+
    | 10.5.13-MariaDB |
    +-----------------+
    

 

Komentar

Postingan populer dari blog ini

CREATE CROSS TAB QUERY IN MYSQL

MySQL Multi-Aggregated Rows in Crosstab Queries MySQL’s crosstabs contain aggregate functions on two or more fields, presented in a tabular format. In a multi-aggregate crosstab query, two different functions can be applied to the same field or the same function can be applied to multiple fields on the same (row or column) axis. Rob Gravelle shows you how to apply two different functions to the same field in order to create grouping levels in the row axis. Today’s topic of discussion is crosstabs, which contain multiple aggregate functions in the row axis of a tabular resultset. Recall from the the  All About the Crosstab Query  article that an aggregate function is one that summarizes a group of related data in some way. Examples of aggregate functions include COUNT, SUM, AVG, MIN, and MAX. In a multi-aggregate crosstab query, two different functions can be applied to the same field or the same function can be applied to two or more fields. Today we’ll create a query...

Mysql Import data from CSV File

  Microsoft Windows [Version 10.0.15063] (c) 2017 Microsoft Corporation. All rights reserved. C:\Users\PSI011>cd C:\xampp\mysql\bin C:\xampp\mysql\bin> mysqld 2017-08-22 14:24:49 15428 [Note] mysqld (mysqld 10.1.25-MariaDB) starting as process 16352 ... C:\xampp\mysql\bin> mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 9 Server version: 10.1.25-MariaDB mariadb.org binary distribution Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> use pkh; Database changed MariaDB [pkh]> LOAD DATA LOCAL INFILE 'D:/2017/PKH_FOR_BPKP/PKH_FOR_BPKP_01.csv' -> INTO TABLE pkh_bpkp -> FIELDS TERMINATED BY ',' -> OPTIONALLY ENCLOSED BY '"' -> ESCAPED BY '"' -> LINES TERMINATED BY '\n...

Pentaho Data Integration: Membuat Koneksi ke database MSSQL Server 2008 R2

Untuk terhubung ke database SQL Server langkah-langkah berikut harus dilakukan:   Download Driver Microsoft JDBC di https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774  Tutup Spoon atau Kettle project  Unzip/extract paket dalam direktori temporer (bebas) Copy '<temp directory> \ sqljdbc_6.0\enu\auth\x64\ sqljdbc_auth.dll' ke 'C:\Program Files\Java\jre1.8.0_131' atau sesuaikan dengan path java runtime terinstall  Copy '<temp directory>\ sqljdbc_6.0\enu\jre8\sqljdbc42.jar' ke '<Kettle folder instalasi> \ data-integration \ lib' Buka Spoon atau Kettle project Uji koneksi dalam Spoon Hapus direktori temporer karena sudah tidak digunakan lagi Jika kita meng-upgrade Kettle, Java, JDBC Driver ke versi yang lebih tinggi, maka serangkaian langkah-langkah di atas harus diulang lagi.