・MariaDB にログイン

[root@alma]# mysql -u root※初期設定ではパスワードは登録されていません
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.5.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)]> select user,host,password from mysql.user;※パスワード登録確認
+-------------+-----------+----------+
| User| Host| Password |
+-------------+-----------+----------+
| mariadb.sys | localhost ||
| root| localhost | invalid|※パスワードが invalid(無効)になってます
| mysql| localhost | invalid|
+-------------+-----------+----------+
3 rows in set (0.002 sec)

MariaDB [(none)]> ALTER USER 'root'@'localhost' IDENTIFIED BY "********";※パスワードの設定
Query OK, 0 rows affected (0.004 sec)※「********」がパスワード

MariaDB [(none)]> select user,host,password from mysql.user;※パスワードの設定確認
+-------------+-----------+-------------------------------------------+
| User| Host| Password|
+-------------+-----------+-------------------------------------------+
| mariadb.sys | localhost ||
| root| localhost | *erdkjdkjfelkkkjkkhujggikjunhkgewgegegw2q |※パスワード OK
| mysql| localhost | invalid|
+-------------+-----------+-------------------------------------------+
3 rows in set (0.002 sec)

MariaDB [(none)]> select host,user from mysql.user;※ユーザー確認
+-----------+-------------+
| Host| User|
+-----------+-------------+
| localhost | mariadb.sys |
| localhost | mysql|
| localhost | root|
+-----------+-------------+
3 rows in set (0.001 sec)

MariaDB [(none)]> show databases;※データベース確認
+--------------------+
| Database|
+--------------------+
| information_schema |
| mysql|
| performance_schema |
+--------------------+
3 rows in set (0.001 sec)

MariaDB [(none)]> show variables like '%char%';※文字コード確認
+--------------------------+------------------------------+
| Variable_name| Value|
+--------------------------+------------------------------+
| character_set_client| utf8mb4|
| character_set_connection | utf8mb4|
| character_set_database| utf8mb4|
| character_set_filesystem | binary|
| character_set_results| utf8mb4|
| character_set_server| utf8mb4|
| character_set_system| utf8|
| character_sets_dir| /usr/share/mariadb/charsets/ |
+--------------------------+------------------------------+
8 rows in set (0.002 sec)

MariaDB [(none)]> exit※終了

*** 参考 ***

MariaDB [(none)]> delete from mysql.user where user='****';※ユーザ **** の削除

MariaDB [(none)]> drop database ********;※データベース ******** の削除