Fedora36: Database settings

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

Configure MariaDB.

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

Add to [mysqld].

[mysqld]
character-set-server=utf8

start up.

[root@www ~]# systemctl start mariadb

Set auto start.

[root@www ~]# systemctl enable mariadb

Initialize.

[root@www ~]# mysql_secure_installation

After the following is displayed, press “Enter”.

Enter current password for root (enter for none):

Set the root password.

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

Reply with ‘y’.

Remove anonymous users? [Y/n] y

Reply with ‘y’.

Disallow root login remotely? [Y/n] y

Reply with ‘y’.

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

Reply with ‘y’.

Reload privilege tables now? [Y/n] y

Connect to MariaDB as root user.

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

Display the user information list.

MariaDB [(none)]> select 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)

Display the database list.

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

Exit.

MariaDB [(none)]> exit

Install phpMyAdmin

Install and start httpd.

httpd

Have PHP installed.

PHP

Download phpMyAdmin and unzip it.

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

Configure phpMyAdmin.

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

Line 13: Add access permission IP.

Require ip 127.0.0.1 192.168.1.1/24

Line 19: Add access permission IP.

Require ip 127.0.0.1 192.168.1.1/24

Restart.

[root@www ~]# systemctl restart httpd

Start a web browser, access the following URL, authenticate as a registered user, and log in. (You can operate MariaDB from the management screen.)

http://fedoraserver.jp/phpmyadmin/

phpmyadmin

コメント

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