install
dnf install mariadb-server.x86_64
config
文字コードをUTF-8にする
/etc/my.cnf.d/mariadb-server.cnf
[server]
character-set-server = utf8mb4
collation-server = utf8mb4_bin
start
systemctl restart mariadb
inital setting
mysql_secure_installation
check
mariadb
> status
MariaDB [(none)]> status
--------------
mariadb Ver 15.1 Distrib 10.5.22-MariaDB, for Linux (x86_64) using EditLine wrapper
Connection id: 13
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server: MariaDB
Server version: 10.5.22-MariaDB MariaDB Server
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 6 min 4 sec
Threads: 1 Questions: 24 Slow queries: 0 Opens: 20 Open tables: 13 Queries per second avg: 0.065
--------------
login config
~/.my.cnf
[client_other]
host='<your-db-host>'
port='<your-db-port>'
socket='<your-db-socket>'
database='<your-db-name>'
user='<your-db-user>'
password='<your-db-password>'
ユーザ名やDB名はシングルクォートで括らなくても大丈夫だったが、passwordだけはシングルクォートで括るのが無難と思われる
login to DB
mariadb --defaults-group-suffix=_other
参考