Fedora36:データベース設定

s50

MariaDB の インストール.

MariaDB をインストールします。

[root@www ~]# 50_1dnf -y install mariadb-server

s51MariaDB を設定します。

[root@www ~]# 51_1vi /etc/my.cnf.d/mariadb-server.cnf

s52[mysqld]に追記します。

[mysqld]
52_1character-set-server=utf8

s53起動します。

[root@www ~]# 53_1systemctl start mariadb

s54自動起動設定します。

[root@www ~]# 54_1systemctl enable mariadb

s55初期設定します。

[root@www ~]# 55_1mysql_secure_installation

s56下記の表示後、「Enter」を押下します。

Enter current password for root (enter for none):

s57root パスワードを設定します。

Set root password? [Y/n] 57_1y
New password:
Re-enter new password:

s58「y」で応答します。

Remove anonymous users? [Y/n] 58_1y

s59「y」で応答します。

Disallow root login remotely? [Y/n] 59_1y

s60「y」で応答します。

Remove test database and access to it? [Y/n] 60_1y

s61「y」で応答します。

Reload privilege tables now? [Y/n] 61_1y

s62MariaDBにrootユーザーで接続します。

[root@www ~]# 62_1mysql -u root -p
Enter password:

s63ユーザー情報一覧を表示します。

MariaDB [(none)]> 63_1select user,host,password from mysql.user;
+------+-----------+-------------------------------------------+
| user | host      | password                                  |
+------+-----------+-------------------------------------------+
| root | localhost | ***************************************** |
| root | 127.0.0.1 | ***************************************** |
| root | ::1       | ***************************************** |
+------+-----------+-------------------------------------------+
3 rows in set (0.00 sec)

s64データベース一覧を表示します。

MariaDB [(none)]> 64_1show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

s65終了します。

MariaDB [(none)]> 65_1exit

s66

phpMyAdmin のインストール.

httpdをインストールしておきます。

httpd

s67PHP をインストールしておきます。

PHP

s68phpMyAdminをダウンロードし、解凍します。

[root@www ~]# 68_1dnf -y install phpMyAdmin php-mysqlnd php-mcrypt php-php-gettext

s69phpMyAdminを設定します。

[root@www ~]# 69_1vi /etc/httpd/conf.d/phpMyAdmin.conf

s7013行目:アクセス許可IPを追記します。

70_1Require ip 127.0.0.1 192.168.1.1/24

s7119行目:アクセス許可IPを追記します。

71_1Require ip 127.0.0.1 192.168.1.1/24

s72再起動します。

[root@www ~]# 72_1systemctl restart httpd

s73Webブラウザを起動し、下記のURLにアクセスし、登録したユーザーで認証してログインします。(管理画面から MariaDB を操作することができます。)

http://fedoraserver.jp/phpmyadmin/

phpmyadmin

コメント

タイトルとURLをコピーしました