LoginSignup
54
50

More than 5 years have passed since last update.

CentOS7にyumでMariaDB最新版インストール

Last updated at Posted at 2017-08-23

公式HP見てたらワンライナーがあったのでメモ
#2018/6/3 少しコマンドが変わっていたので更新

ワンライナーには環境依存はないけれど一応
Host OS : CentOS7.3
Target : Mariadb-10.2

リポジトリインストール

$ curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
これだけ

バージョン指定したい場合は
$ curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=mariadb-10.0

その他のオプションは下記URLに
https://mariadb.com/kb/en/the-mariadb-library/mariadb-package-repository-setup-and-usage/

MariaDBインストール

インストール

$ sudo yum install MariaDB-server MariaDB-client

サービス開始

$ sudo systemctl start mariadb

起動時にサービス開始

$ sudo systemctl enable mariadb

接続確認

$ mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.                                            
Your MariaDB connection id is 8                    
Server version: 10.2.8-MariaDB MariaDB Server      

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)]> 

となれば完了

$ mysql_secure_installation
で初期設定

備考

ワンライナーは下記OSに対応
- Red Hat Enterprise Linux (RHEL)/CentOS 6 and 7
- Debian 7 (wheezy) and 8 (jessie)
- Ubuntu 14.04 LTS (trusty) and 16.04 LTS (xenial)
- SUSE Linux Enterprise Server (SLES) 12

54
50
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
54
50