MariaDB Mysql

MariaDB 설치, 설정

enterit 2023. 4. 6. 13:59

# rpm -qa | grep mariadb

 

# dnf install mariadb-server

 

# rpm -qa | grep mariadb

mariadb-connector-c-config-3.2.6-1.el9_0.noarch
mariadb-common-10.5.16-2.el9_0.x86_64
mariadb-connector-c-3.2.6-1.el9_0.x86_64
mariadb-errmsg-10.5.16-2.el9_0.x86_64
mariadb-10.5.16-2.el9_0.x86_64
mariadb-backup-10.5.16-2.el9_0.x86_64
mariadb-gssapi-server-10.5.16-2.el9_0.x86_64
mariadb-server-utils-10.5.16-2.el9_0.x86_64
mariadb-server-10.5.16-2.el9_0.x86_64

 

# systemctl start mariadb

# systemctl status mariadb
● mariadb.service - MariaDB 10.5 database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
     Active: active (running) since Thu 2023-04-06 14:57:42 KST; 2s ago
       Docs: man:mariadbd(8)
             
https://mariadb.com/kb/en/library/systemd/
    Process: 12886 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS)
    Process: 12908 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
    Process: 13013 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exited, status=0/SUCCESS)
   Main PID: 12994 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 18 (limit: 10980)
     Memory: 73.3M
        CPU: 1.018s
     CGroup: /system.slice/mariadb.service
             └─12994 /usr/libexec/mariadbd --basedir=/usr

 4월 06 14:57:42 db1 mariadb-prepare-db-dir[12947]: you need to be the system 'mysql' user to connect.
 4월 06 14:57:42 db1 mariadb-prepare-db-dir[12947]: After connecting you can set the password, if you would need to be
 4월 06 14:57:42 db1 mariadb-prepare-db-dir[12947]: able to connect as any of these users with a password and without sudo
 4월 06 14:57:42 db1 mariadb-prepare-db-dir[12947]: See the MariaDB Knowledgebase at 
https://mariadb.com/kb
 4월 06 14:57:42 db1 mariadb-prepare-db-dir[12947]: Please report any problems at 
https://mariadb.org/jira
 4월 06 14:57:42 db1 mariadb-prepare-db-dir[12947]: The latest information about MariaDB is available at 
https://mariadb.org/.
 4월 06 14:57:42 db1 mariadb-prepare-db-dir[12947]: Consider joining MariaDB's strong and vibrant community:
 4월 06 14:57:42 db1 mariadb-prepare-db-dir[12947]: 
https://mariadb.org/get-involved/
 4월 06 14:57:42 db1 mariadbd[12994]: 2023-04-06 14:57:42 0 [Note] /usr/libexec/mariadbd (mysqld 10.5.16-MariaDB) starting as process 12994 ...
 4월 06 14:57:42 db1 systemd[1]: Started MariaDB 10.5 database server.

# systemctl enable mariadb

# /usr/bin/mysql_secure_installation

에러 발생시 직접 설정

# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.5.16-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 version();
+-----------------+
| 10.5.16-MariaDB |
+-----------------+
1 row in set (0.001 sec)

MariaDB [(none)]> use mysql;

MariaDB [mysql]> select * from user;