9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

yumでmysql(maria DB)を最新安定バージョンにアップデートする(Cent OS7)

Last updated at Posted at 2017-10-17

mariadbが5.5.40と古いバージョンになっていたので、これを最新安定版の10.1.21にアップデートする方法のメモ

yumリポジトリの追加

MariaDBリポジトリ情報の生成

repository generatorを使って、指定のmaria DBバージョンのyumリポジトリ情報を生成し、追加する。

yumリポジトリのMariaDBリポジトリを追加

/etc/yum.repos.d/MariaDB.repoが無ければ新規作成

/etc/yum.repos.d/MariaDB.repo
# MariaDB 10.1 CentOS repository list - created 2017-02-07 07:13 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

yumでMariaDBをインストール・アップデート

新規のインストールの場合

sudo yum install MariaDB-server MariaDB-client

アップデートの場合

# systemctl stop mariadb
# systemctl status mariadb
mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled)
   Active: inactive (dead)

 
# yum update MariaDB-server MariaDB-client
読み込んだプラグイン:fastestmirror, remove-with-leaves, show-leaves
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: ftp.riken.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
依存性の解決をしています

  〜 略 〜

# mysql --version
mysql  Ver 15.1 Distrib 10.1.21-MariaDB, for Linux (x86_64) using readline 5.1

# systemctl start mariadb

# mysql -u root -e 'status'
--------------
mysql  Ver 15.1 Distrib 10.1.21-MariaDB, for Linux (x86_64) using readline 5.1

Connection id:		2
Current database:
Current user:		root@localhost
SSL:			Not in use
Current pager:		stdout
Using outfile:		''
Using delimiter:	;
Server:			MariaDB
Server version:		10.1.21-MariaDB MariaDB Server
Protocol version:	10
Connection:		Localhost via UNIX socket
Server characterset:	latin1
Db     characterset:	latin1
Client characterset:	utf8
Conn.  characterset:	utf8
UNIX socket:		/var/lib/mysql/mysql.sock
Uptime:			3 sec

Threads: 1  Questions: 4  Slow queries: 0  Opens: 16  Flush tables: 1  Open tables: 9  Queries per second avg: 1.333
--------------
9
10
1

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
9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?