MariaDBをWindowsOSへインストールする手順とDBの作成手順を紹介します。
MariaDBとは
- MySQLを元に作成されてオープンソースデータベース
- 代表的なLinuxのディストリビューションでは標準データベースになりつつある
- GoogleやWikipediaなどもMariaDBを採用している
とこれからのデファクトスタンダードになるデータベースです。
目次
インストール環境
今回のインストール環境は以下になります。
- iインストールするOS:Windows 10 64bit
- MariaDB Server:MariaDB 10.3 Series
MariaDBのダウンロード
まずはMariaDBのメディアをダウンロードします。
ダウンロードリンク:https://downloads.mariadb.org/赤枠のDownloadボタンから最新版を選択します。
![MariaDBのダウンロードサイト](https://shimi-dai.com/wp-content/uploads/2018/06/001-7-1024x728.jpg)
インストールメディア「mariadb-x.x.x-winxXX.msi」を設定します。
インストールするWindowsOSのBit数を間違えないようにしましょう。
![MariaDBのWindowsダウンロードページ](https://shimi-dai.com/wp-content/uploads/2018/06/002-4-1024x593.jpg)
MariaDBのインストール手順
ダウンロードした「mariadb-x.x.x-winxXX.msi」でインストール開始します。
インストールメディアを実行して「Next」を選択します。
![MariaDBのインストール](https://shimi-dai.com/wp-content/uploads/2018/06/003-3.jpg)
「I Accept the terms in the License Agreement」を選択して「次へ」を選択します。
![MariaDBインストールで「I](https://shimi-dai.com/wp-content/uploads/2018/06/004-3.jpg)
今回はMariaDB Serverとすべてのユーティリティを選択して「Next」を選択します。
![MariaDB](https://shimi-dai.com/wp-content/uploads/2018/06/005-2.jpg)
rootのパスワードと文字コードをUTF-8で設定し、次へを選択します。
![rootのパスワードとUTF-8の設定](https://shimi-dai.com/wp-content/uploads/2018/06/006-3.jpg)
Service NameとBuffer pool sizeで設定し、次へを選択します。
![Service](https://shimi-dai.com/wp-content/uploads/2018/06/007-1.jpg)
特になにも選択せずに次へを選択する。
![Feedbackの有無を選択する](https://shimi-dai.com/wp-content/uploads/2018/06/008-1.jpg)
ここまで来たらInstallを選択します。
![MariaDBをInstallを開始する](https://shimi-dai.com/wp-content/uploads/2018/06/009-1.jpg)
下の画面が表示されてばインストール完了です。
「MySQL Client」
を起動して、インストールが完了していることを確認します。
Enter password: ********
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.3.7-MariaDB mariadb.org binary distribution
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 databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.001 sec)
MariaDBにデータベースを作成
MariaDBでデータベースを作成します。手順の流れは以下になります。
- MySQL Clientでrootユーザでログイン
- データベース作成
- データベース作成ユーザの作成と権限の付与
下がデータベース作成コマンドになります。
create database <データベース名> character set utf8;
grant all privileges on <データベース名>.* to <ユーザ名>@localhost identified by '<ログインパスワード>';
下が実際に「testdb」を作成する場合の例です。
Enter password: ********
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.3.7-MariaDB mariadb.org binary distribution
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)]> create database testdb character set utf8;
Query OK, 1 row affected (0.005 sec)
MariaDB [(none)]> grant all privileges on testdb.* to testdb_user@localhost identified by 'testdb_user';
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
| testdb |
+--------------------+
5 rows in set (0.001 sec)
created by Rinker
¥959
(2024/07/26 16:36:38時点 Amazon調べ-詳細)