データベースを構築するためにMariaDBをインストールする
インストール
dnf install mariadb-server
dnf install mariadb-server
dnf install mariadb-server
バージョン確認
今回インストールしたバージョンは10.3.27
mysql -V
mysql Ver 15.1 Distrib 10.3.27-MariaDB, for Linux (x86_64) using readline 5.1
mysql -V
mysql Ver 15.1 Distrib 10.3.27-MariaDB, for Linux (x86_64) using readline 5.1
mysql -V mysql Ver 15.1 Distrib 10.3.27-MariaDB, for Linux (x86_64) using readline 5.1
サービス起動・自動起動
systemctl start mariadb
systemctl enable mariadb
systemctl status mariadb
systemctl start mariadb
systemctl enable mariadb
systemctl status mariadb
systemctl start mariadb systemctl enable mariadb systemctl status mariadb
設定
mysql_secure_installation
mysql_secure_installation
mysql_secure_installation
Enter current password for root (enter for none): ← Enterを押す
Set root password? [Y/n] ← Enterを押す
New password: ← パスワードを設定
Re-enter new password: ← パスワードを設定
Remove anonymous users? [Y/n] ← Enterを押す
Disallow root login remotely? [Y/n] ← Enterを押す
Remove test database and access to it? [Y/n] ← Enterを押す
Reload privilege tables now? [Y/n] ← Enterを押す
Enter current password for root (enter for none): ← Enterを押す
Set root password? [Y/n] ← Enterを押す
New password: ← パスワードを設定
Re-enter new password: ← パスワードを設定
Remove anonymous users? [Y/n] ← Enterを押す
Disallow root login remotely? [Y/n] ← Enterを押す
Remove test database and access to it? [Y/n] ← Enterを押す
Reload privilege tables now? [Y/n] ← Enterを押す
Enter current password for root (enter for none): ← Enterを押す Set root password? [Y/n] ← Enterを押す New password: ← パスワードを設定 Re-enter new password: ← パスワードを設定 Remove anonymous users? [Y/n] ← Enterを押す Disallow root login remotely? [Y/n] ← Enterを押す Remove test database and access to it? [Y/n] ← Enterを押す Reload privilege tables now? [Y/n] ← Enterを押す
ログイン確認
mysql -u root -p
Enter password: ← パスワードを入力
mysql -u root -p
Enter password: ← パスワードを入力
mysql -u root -p Enter password: ← パスワードを入力
下記のように表示されればログインできている
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 22
Server version: 10.3.27-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)]>
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 22
Server version: 10.3.27-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)]>
Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 22 Server version: 10.3.27-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)]>
コメント