2019年10月に下記の記事を記載しました。すでに10.4がOld Stableとは…
先日、MariaDBのTwitterに新しいRepository Configuration toolができたようなので、10.5をインストールしてみました。
https://t.co/FpKZxAc2NJ: Downloads – A fresh new look https://t.co/32u8Iiaqzx
— MariaDB Foundation (@mariadb_org) July 22, 2020
ちなみに今まで使用していた下記のサイトはまだ残っていました。
Downloads Setting up MariaDB Repositories
https://downloads.mariadb.org/mariadb/repositories/#distro=CentOS&distro_release=centos8-amd64–centos8&mirror=yamagata-university&version=10.5
環境
・CentOS Linux release 8.2.2004 (Core)
・Kernel 4.18.0-193.6.3.el8_2.x86_64
- MariaDB Repository作成
- MariaDB 10.5 install
- 自動起動設定と起動
- 初期設定()
下記サイトからディストリビューション、サーババージョン、ミラーサイトを設定するとRepositoryファイルに記載する内容が表示されます。
https://mariadb.org/download/#mariadb-repositories
日本のミラーサイトは山形大学だけしかありませんでした。今後増えるのかな?
1 2 3 4 5 6 7 8 9 10 11 |
[root@centos8 ~]# vi /etc/yum.repos.d/MariaDB.repo [root@centos8 ~]# cat /etc/yum.repos.d/MariaDB.repo # MariaDB 10.5 [Stable] CentOS repository list - created 2020-07-24 03:11 UTC # https://mariadb.org/download-test/ [mariadb] name = MariaDB baseurl = http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/yum/10.5/centos8-amd64 module_hotfixes=1 gpgkey=http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/yum/RPM-GPG-KEY-MariaDB gpgcheck=1 enabled=1 |
有効にする為にenabled=1を追加しています。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
[root@centos8 ~]# dnf info MariaDB Available Packages Name : MariaDB Version : 10.5.4 Release : 1.el8 Architecture : src Size : 77 M Source : None Repository : mariadb Summary : MariaDB: a very fast and robust SQL database server License : GPLv2 Description : MariaDB: a very fast and robust SQL database server : : It is GPL v2 licensed, which means you can use the it free of charge : under the conditions of the GNU General Public License Version 2 : (http://www.gnu.org/licenses/). : : MariaDB documentation can be found at https://mariadb.com/kb : MariaDB bug reports should be submitted through : https://jira.mariadb.org Name : mariadb Epoch : 3 Version : 10.3.17 Release : 1.module_el8.1.0+257+48736ea6 Architecture : x86_64 Size : 6.1 M Source : mariadb-10.3.17-1.module_el8.1.0+257+48736ea6.src.rpm Repository : AppStream Summary : A very fast and robust SQL database server URL : http://mariadb.org License : GPLv2 with exceptions and LGPLv2 and BSD Description : MariaDB is a community developed branch of MySQL - a multi-user, : multi-threaded SQL database server. It is a client/server : implementation consisting of a server daemon (mysqld) and many : different client programs and libraries. The base package contains : the standard MariaDB/MySQL client programs and generic MySQL files. [root@centos8 ~]# dnf install MariaDB Last metadata expiration check: 0:04:31 ago on Fri Jul 24 12:16:53 2020. Dependencies resolved. ==================================================================================== Package Arch Version Repo Size ==================================================================================== Installing: MariaDB-server x86_64 10.5.4-1.el8 mariadb 27 M Installing dependencies: MariaDB-client x86_64 10.5.4-1.el8 mariadb 13 M MariaDB-common x86_64 10.5.4-1.el8 mariadb 87 k MariaDB-shared x86_64 10.5.4-1.el8 mariadb 116 k boost-program-options x86_64 1.66.0-7.el8 AppStream 140 k galera-4 x86_64 26.4.5-1.el8 mariadb 13 M perl-DBI x86_64 1.641-3.module_el8.1.0+199+8f0a6bbd AppStream 740 k perl-Math-BigInt noarch 1:1.9998.11-7.el8 BaseOS 196 k perl-Math-Complex noarch 1.59-416.el8 BaseOS 108 k socat x86_64 1.7.3.3-2.el8 AppStream 302 k Enabling module streams: perl 5.26 perl-DBI 1.641 Transaction Summary ==================================================================================== Install 10 Packages Total download size: 54 M Installed size: 57 M Is this ok [y/N]: y Downloading Packages: (1/10): boost-program-options-1.66.0-7.el8.x86_64.r 289 kB/s | 140 kB 00:00 (2/10): socat-1.7.3.3-2.el8.x86_64.rpm 621 kB/s | 302 kB 00:00 (3/10): perl-DBI-1.641-3.module_el8.1.0+199+8f0a6bb 1.1 MB/s | 740 kB 00:00 (4/10): perl-Math-Complex-1.59-416.el8.noarch.rpm 508 kB/s | 108 kB 00:00 (5/10): perl-Math-BigInt-1.9998.11-7.el8.noarch.rpm 727 kB/s | 196 kB 00:00 (6/10): MariaDB-common-10.5.4-1.el8.x86_64.rpm 1.3 MB/s | 87 kB 00:00 (7/10): MariaDB-shared-10.5.4-1.el8.x86_64.rpm 1.8 MB/s | 116 kB 00:00 (8/10): galera-4-26.4.5-1.el8.x86_64.rpm 16 MB/s | 13 MB 00:00 (9/10): MariaDB-server-10.5.4-1.el8.x86_64.rpm 11 MB/s | 27 MB 00:02 (10/10): MariaDB-client-10.5.4-1.el8.x86_64.rpm 4.9 MB/s | 13 MB 00:02 ------------------------------------------------------------------------------------ Total 12 MB/s | 54 MB 00:04 warning: /var/cache/dnf/mariadb-a9b0442ab0f25d9a/packages/MariaDB-client-10.5.4-1.el8.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY MariaDB 203 kB/s | 8.2 kB 00:00 Importing GPG key 0x1BB943DB: Userid : "MariaDB Package Signing Key <package-signing-key@mariadb.org>" Fingerprint: 1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB From : http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/yum/RPM-GPG-KEY-MariaDB Is this ok [y/N]: y Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Running scriptlet: MariaDB-shared-10.5.4-1.el8.x86_64 1/10 Installing : MariaDB-shared-10.5.4-1.el8.x86_64 1/10 Running scriptlet: MariaDB-shared-10.5.4-1.el8.x86_64 1/10 Running scriptlet: MariaDB-common-10.5.4-1.el8.x86_64 2/10 Installing : MariaDB-common-10.5.4-1.el8.x86_64 2/10 Running scriptlet: MariaDB-common-10.5.4-1.el8.x86_64 2/10 Running scriptlet: MariaDB-client-10.5.4-1.el8.x86_64 3/10 Installing : MariaDB-client-10.5.4-1.el8.x86_64 3/10 Running scriptlet: MariaDB-client-10.5.4-1.el8.x86_64 3/10 Installing : perl-Math-Complex-1.59-416.el8.noarch 4/10 Installing : perl-Math-BigInt-1:1.9998.11-7.el8.noarch 5/10 Installing : perl-DBI-1.641-3.module_el8.1.0+199+8f0a6bbd.x86_64 6/10 Installing : socat-1.7.3.3-2.el8.x86_64 7/10 Installing : boost-program-options-1.66.0-7.el8.x86_64 8/10 Running scriptlet: boost-program-options-1.66.0-7.el8.x86_64 8/10 Running scriptlet: galera-4-26.4.5-1.el8.x86_64 9/10 Installing : galera-4-26.4.5-1.el8.x86_64 9/10 Running scriptlet: galera-4-26.4.5-1.el8.x86_64 9/10 Running scriptlet: MariaDB-server-10.5.4-1.el8.x86_64 10/10 Installing : MariaDB-server-10.5.4-1.el8.x86_64 10/10 Running scriptlet: MariaDB-server-10.5.4-1.el8.x86_64 10/10 Two all-privilege accounts were created. One is root@localhost, it has no password, but you need to be system 'root' user to connect. Use, for example, sudo mysql The second is mysql@localhost, it has no password either, but you need to be the system 'mysql' user to connect. After connecting you can set the password, if you would need to be able to connect as any of these users with a password and without sudo See the MariaDB Knowledgebase at https://mariadb.com/kb or the MySQL manual for more instructions. Please report any problems at https://mariadb.org/jira The latest information about MariaDB is available at https://mariadb.org/. You can find additional information about the MySQL part at: https://dev.mysql.com Consider joining MariaDB's strong and vibrant community: https://mariadb.org/get-involved/ Verifying : boost-program-options-1.66.0-7.el8.x86_64 1/10 Verifying : perl-DBI-1.641-3.module_el8.1.0+199+8f0a6bbd.x86_64 2/10 Verifying : socat-1.7.3.3-2.el8.x86_64 3/10 Verifying : perl-Math-BigInt-1:1.9998.11-7.el8.noarch 4/10 Verifying : perl-Math-Complex-1.59-416.el8.noarch 5/10 Verifying : MariaDB-client-10.5.4-1.el8.x86_64 6/10 Verifying : MariaDB-common-10.5.4-1.el8.x86_64 7/10 Verifying : MariaDB-server-10.5.4-1.el8.x86_64 8/10 Verifying : MariaDB-shared-10.5.4-1.el8.x86_64 9/10 Verifying : galera-4-26.4.5-1.el8.x86_64 10/10 Installed: MariaDB-client-10.5.4-1.el8.x86_64 MariaDB-common-10.5.4-1.el8.x86_64 MariaDB-server-10.5.4-1.el8.x86_64 MariaDB-shared-10.5.4-1.el8.x86_64 boost-program-options-1.66.0-7.el8.x86_64 galera-4-26.4.5-1.el8.x86_64 perl-DBI-1.641-3.module_el8.1.0+199+8f0a6bbd.x86_64 perl-Math-BigInt-1:1.9998.11-7.el8.noarch perl-Math-Complex-1.59-416.el8.noarch socat-1.7.3.3-2.el8.x86_64 Complete! |
1 2 3 |
[root@centos8 ~]# systemctl enable mariadb Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service -> /usr/lib/systemd/system/mariadb.service. [root@centos8 ~]# systemctl start mariadb |
Unix Socket認証を無効にしてrootのパスワードを変更しています。
Authentication Plugin – Unix Socket
https://mariadb.com/kb/en/authentication-plugin-unix-socket/
Unix Socket認証、理解できていません(^^;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
[root@centos8 ~]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and haven't set the root password yet, you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password or using the unix_socket ensures that nobody can log into the MariaDB root user without the proper authorisation. You already have your root account protected, so you can safely answer 'n'. Switch to unix_socket authentication [Y/n] n ... skipping. You already have your root account protected, so you can safely answer 'n'. Change the root password? [Y/n] Y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] Y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] Y ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] Y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] Y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
[root@centos8 ~]# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 11 Server version: 10.5.4-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)]> show variables like 'char%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | latin1 | | character_set_connection | latin1 | | character_set_database | latin1 | | character_set_filesystem | binary | | character_set_results | latin1 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ 8 rows in set (0.001 sec) MariaDB [(none)]> status; -------------- mysql Ver 15.1 Distrib 10.5.4-MariaDB, for Linux (x86_64) using readline 5.1 Connection id: 11 Current database: Current user: root@localhost SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server: MariaDB Server version: 10.5.4-MariaDB MariaDB Server Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: latin1 Db characterset: latin1 Client characterset: latin1 Conn. characterset: latin1 UNIX socket: /var/lib/mysql/mysql.sock Uptime: 18 min 46 sec Threads: 2 Questions: 21 Slow queries: 0 Opens: 20 Open tables: 14 Queries per second avg: 0.018 -------------- MariaDB [(none)]> quit Bye |