Help us understand the problem. What is going on with this article?

EC2(Amazon Linux 2)にmariaDBを導入する

今回の目的

先輩から教えてもらったサーバー構築の備忘録、物理サーバーでやったことをAWSで確認中。
mariadbをインストールし,EC2内でログインする。前回下の原因でできなかったDBをインストールします。

注意事項

Amazon Linux 2のインスタンスを使用すること。Amazon Linuxだとmariadbがサポートされていません!

インストール

# インストール
$ sudo yum install -y mariadb-server

# 起動
$ sudo systemctl start mariadb

# 有効化
$ sudo systemctl enable mariadb
$ sudo systemctl is-enabled mariadb

# セキュリティ設定 rootのパスワード等を設定します。全部Yでもいいかなと思っています。
$ sudo mysql_secure_installation
Set root password? [Y/n]
Remove anonymous users? [Y/n]
Disallow root login remotely? [Y/n]
Remove test database and access to it? [Y/n] n
Reload privilege tables now? [Y/n]
 ...
Thanks for using MariaDB!


ログインしてみよう

#ルートユーザーでログイン、パスワード付きで
mysql -u root  -p

Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 23
Server version: 10.3.16-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)]> exit
Bye

これでmariadbがEC2内で使えるようになりました。大規模でなければRDSでなくてもいいと思います。
次はSSL認証をやっていこうと思います。それでは!

参考文献

Amazon Linux 2でサーバ作成 (Apache2.4+PHP7.2+MariaDB)

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away