Ubuntu 21.10にMariaDBをインストールする

OSバージョンの確認
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=21.10
DISTRIB_CODENAME=impish
DISTRIB_DESCRIPTION="Ubuntu 21.10″

MariaDBインストールの方法
1.パッケージのアップデート
# sudo apt-get update

2.MariaDBをインストール

# sudo apt-get -y install mariadb-server mariadb-client libmariadb-dev

「mariadb-server-10.5を設定しています」が表示され、Enterキーを押下します。

3.MariaDBに接続します

# mysql -uroot
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 44
Server version: 10.5.12-MariaDB-1build1 Ubuntu 21.10

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)]>

4.MariaDBバージョンの確認

MariaDB [(none)]> select version();
+-------------------------+
| version()               |
+-------------------------+
| 10.5.12-MariaDB-1build1 |
+-------------------------+

5.rootのパスワードを変更します

MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

MariaDB [mysql]> ALTER USER 'root'@'localhost' IDENTIFIED BY "Test9195";

6.MySQLに再度ログインします

# mysql -uroot -pTest9195
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 51
Server version: 10.5.12-MariaDB-1build1 Ubuntu 21.10

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)]>

 

Ubuntu 21.10

Posted by arkgame