본문 바로가기

Server/Ubuntu

MariaDB 간단한 설치과정

반응형

MariaDB는 오픈 소스 관계형 데이터베이스 관리 시스템(RDBMS)입니다. MySQL 데이터베이스의 포크로 시작되었으며, 뛰어난 성능과 안정성을 제공합니다. MariaDB는 다양한 플랫폼에서 사용할 수 있으며, 웹 애플리케이션, 데이터 웨어하우스, 엔터프라이즈 환경 등 다양한 용도로 사용됩니다.

MariaDB는 MySQL과 호환되며, 기존의 MySQL 사용자들에게 쉬운 전환 경로를 제공합니다. 또한, MariaDB는 많은 개선 및 추가 기능을 제공하여 데이터베이스 성능을 향상시키고 개발자들에게 편의성을 제공합니다.

MariaDB는 커뮤니티에 의해 개발되는 오픈 소스 프로젝트이기 때문에, 개발자들은 쉽게 참여하고 기여할 수 있습니다. 이러한 개방성과 활발한 커뮤니티로 인해 MariaDB는 지속적으로 발전하고 성장하고 있습니다.

간단한 설치과정..

sudo apt-get install mariadb-server mariadb-client -y

sudo mysql_secure_installation

Switch to unix_socket authentication [Y/n] y
Change the root password? [Y/n] y
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
mysql -u root -p

mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 41
Server version: 11.2.2-MariaDB-1:11.2.2+maria~ubu2204 mariadb.org binary distribution

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

bind-address수정 127.0.0.1을 0.0.0.0으로 변경한다.

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

[server]

# this is only for the mariadbd daemon
[mariadbd]

#
# * Basic Settings
#

#user                    = mysql
pid-file                = /run/mysqld/mysqld.pid
basedir                 = /usr
#datadir                 = /var/lib/mysql
#tmpdir                  = /tmp

# Broken reverse DNS slows down connections considerably and name resolve is
# safe to skip if there are no "host by domain name" access grants
#skip-name-resolve

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.

#bind-address            = 127.0.0.1
bind-address            = 0.0.0.0

#
# * Fine Tuning
#

#key_buffer_size        = 128M
#max_allowed_packet     = 1G
#thread_stack           = 192K
#thread_cache_size      = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
#myisam_recover_options = BACKUP
sudo systemctl restart mariadb
sudo systemctl status mariadb

● mariadb.service - MariaDB 11.2.2 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/mariadb.service.d
             └─migrated-from-my.cnf-settings.conf
     Active: active (running) since Sun 2023-11-26 16:03:11 UTC; 1s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 2652249 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 2652250 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 2652253 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP>
    Process: 2652294 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 2652296 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
   Main PID: 2652282 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 13 (limit: 1033)
     Memory: 82.5M
        CPU: 337ms
     CGroup: /system.slice/mariadb.service
             └─2652282 /usr/sbin/mariadbd
반응형