0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

install MariaDB on RockyLinux 9.0

Last updated at Posted at 2024-11-12

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

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?