SlideShare a Scribd company logo
1 of 16
1
http://neoclova.co.kr/
MariaDB10.7_install_Ubuntu
㈜네오클로바
DB컨설팅
2
http://neoclova.co.kr/
3
http://neoclova.co.kr/
개정이력
버전 변경일 변경사유1
변경내용2
작성자 승인자
Ver. 1.0 2022.03.21 최초작성 문서 최초 작성 오혜린
1
변경 사유: 변경 내용이 이전 문서에 대해 최초작성/승인/추가/수정/삭제 중 선택 기입
2
변경 내용: 변경이 발생되는 위치와 변경 내용을 자세히 기록(장.절과 변경 내용을 기술한다.)
4
http://neoclova.co.kr/
목차
1. About MariaDB 4
1.1 5
1.2 5
1.3 5
2. 설치 5
2.1 6
2.2 6
2.3 7
2.4 11
2.5 15
5
http://neoclova.co.kr/
1. About MariaDB
1.1 MariaDB 개요
MariaDB는 전세계적으로 가장 널리 사용되고 있는 Open Source Database System인 MySQL 과의 호
환성을 가지면서 추가적인 기능들을 개발하여 배포/판매하고 있는 데이터베이스이다. 2009년 initial r
elease를 했다.
1.2 MariaDB as a R-DBMS
관계형 데이터베이스는 데이터를 하나의 커다란 저장 공간에 저장하지 않고 서로 별개의 테이블에 나
누어서 저장을 하는 시스템이다. 이를 통해 처리 속도와 유연성이 확보된다. SQL은 “Structured Query
language”의 약자이며, SQL은 ANSI/ISO 표준에서 정의한 데이터베이스 접속을 위한 가장 일반적인
표준 언어이다. 이 매뉴얼에서 언급하는 “SQL 표준”은 각 시점에서 발표된 SQL표준을 의미하는 것이
다.
1.3 Open Source Database System
MariaDB 데이터베이스는 GPL(GNU Public License)을 준수하는 오픈 소스 데이터베이스이며, GPL을
준수해서 사용하는 모든 사용자에게 무료로 배포되고 있다.
http://mariadb.org/
http://mariadb.com/
6
http://neoclova.co.kr/
2. 설치
2.1 설치 기본 정보
항목 값
OS version Ubuntu 20.04.4 LTS
OS user maria ( 초기 root OS계정 : neoclova )
MariaDB version MariaDB 10.7.3
Base directory /usr/local/mariadb
Data directory /maria_data
Log directory /maria_log
2.2 설치 준비
2.2.1 SSH 접속 설정
openssh-server 설치 (설치가 완료된 후, SSH서비스 자동시작. 상태확인)
neoclova@ubuntu:~$ sudo apt update
neoclova@ubuntu:~$ sudo apt install openssh-server
neoclova@ubuntu:~$ sudo systemctl status ssh
UFW 방화벽 시스템에서 SSH 포트 open
neoclova@ubuntu:~$ sudo ufw allow ssh
XShell등 외부에서 ssh 접속 테스트
ssh 계정명@ip주소 형태
2.2.2 OS 계정 생성
7
http://neoclova.co.kr/
neoclova@ubuntu:~$ sudo groupadd dba
neoclova@ubuntu:~$ sudo useradd maria -g dba -m
neoclova@ubuntu:~$ cat /etc/group | grep dba
dba:x:1001:
neoclova@ubuntu:~$ cat /etc/passwd | grep maria
maria:x:1001:1001::/home/maria:/bin/sh
2.2.3 디렉토리 생성
neoclova@ubuntu:/$ sudo mkdir /maria_data /maria_log
2.2.4 MariaDB Download
https://mariadb.org/download/
https://archive.mariadb.org/
neoclova@ubuntu:/$ cd /usr/local
neoclova@ubuntu:/usr/local$ sudo wget https://mirror.yongbok.net/mariadb/mariadb-10.7.3/
bintar-linux-systemd-x86_64/mariadb-10.7.3-linux-systemd-x86_64.tar.gz
neoclova@ubuntu:/usr/local$ ls -lah mariadb-10.7.3-linux-systemd-x86_64.tar.gz
-rw-r--r-- 1 root root 331M Feb 11 15:48 mariadb-10.7.3-linux-systemd-x86_64.tar.gz
2.3 MariaDB 설치
2.3.1 MariaDB 엔진 설치 (tar 압축 해제 / 심볼릭 링크 / chown 설정)
neoclova@ubuntu:/usr/local$ sudo tar -zxf mariadb-10.7.3-linux-systemd-x86_64.tar.gz
neoclova@ubuntu:/usr/local$ sudo ln -s mariadb-10.7.3-linux-systemd-x86_64 mariadb
neoclova@ubuntu:/usr/local$ sudo chown -R maria.dba /maria_data
neoclova@ubuntu:/usr/local$ sudo chown -R maria.dba /maria_log
neoclova@ubuntu:/usr/local$ sudo chown -R maria.dba maria*
neoclova@ubuntu:/usr/local$ ls -lah maria*
lrwxrwxrwx 1 maria dba 35 Apr 5 20:19 mariadb -> mariadb-10.7.3-linux-systemd-x86_64
-rw-r--r-- 1 maria dba 331M Feb 11 15:48 mariadb-10.7.3-linux-systemd-x86_64.tar.gz
mariadb-10.7.3-linux-systemd-x86_64:
total 192K
8
http://neoclova.co.kr/
drwxrwxr-x 11 maria dba 4.0K Feb 11 15:47 .
drwxr-xr-x 11 root root 4.0K Apr 5 20:19 ..
drwxr-xr-x 2 maria dba 4.0K Jan 18 09:31 bin
-rw-r--r-- 1 maria dba 18K Feb 10 12:33 COPYING
-rw-r--r-- 1 maria dba 2.1K Feb 10 12:33 CREDITS
drwxrwxr-x 3 maria dba 4.0K Feb 10 13:11 include
-rw-r--r-- 1 maria dba 8.6K Feb 10 12:33 INSTALL-BINARY
drwxr-xr-x 5 maria dba 4.0K Jan 18 09:31 lib
drwxrwxr-x 5 maria dba 4.0K Feb 10 13:12 man
drwxrwxr-x 9 maria dba 4.0K Feb 10 13:12 mysql-test
-rw-r--r-- 1 maria dba 2.7K Feb 10 12:33 README.md
-rw-r--r-- 1 maria dba 20K Feb 10 12:33 README-wsrep
drwxrwxr-x 2 maria dba 4.0K Feb 10 13:12 scripts
drwxrwxr-x 31 maria dba 4.0K Feb 10 13:12 share
drwxrwxr-x 4 maria dba 4.0K Feb 10 13:12 sql-bench
drwxrwxr-x 4 maria dba 4.0K Feb 10 13:12 support-files
-rw-r--r-- 1 maria dba 85K Feb 10 12:33 THIRDPARTY
2.3.2 mysql.server 파일 수정
neoclova@ubuntu:/usr/local$ sudo vi /usr/local/mariadb/support-files/mysql.server
basedir=/usr/local/mariadb
datadir=/maria_data
2.3.3 my.cnf 설정
neoclova@ubuntu:/usr/local$ sudo vi /etc/my.cnf
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
user = maria
port = 3306
socket = /tmp/mysql.sock
basedir = /usr/local/mariadb
datadir = /maria_data
#Log file setting
log-error = /maria_log/mysql.err
slow_query_log = 1
slow_query_log_file = /maria_log/mysql-slow-query.log
long_query_time = 3
#Time-out setting
wait_timeout = 28800
interactive_timeout = 600
9
http://neoclova.co.kr/
# transaction isolation setting
transaction_isolation = READ-COMMITTED
# etc base setting
back_log = 1024
max_connections = 1024
max_connect_errors = 1024
table_open_cache = 2048
max_allowed_packet = 16M
max_heap_table_size = 1024M
sort_buffer_size = 2M
join_buffer_size = 2M
thread_cache_size = 8
tmp_table_size = 1024M
init_connect = "SET collation_connection = utf8_general_ci"
init_connect = "SET NAMES utf8"
character-set-server = utf8
innodb_lock_wait_timeout = 50
innodb_file_per_table
innodb_thread_sleep_delay = 0
innodb_commit_concurrency = 36
innodb_doublewrite = 0
innodb_flush_log_at_trx_commit = 2
innodb_thread_concurrency = 36
innodb_log_files_in_group = 3
innodb_data_file_path = ibdata1:1024M:autoextend
innodb_log_file_size = 256M
innodb_buffer_pool_size = 4G
innodb_log_buffer_size = 32M
innodb_change_buffering=none
key_buffer_size = 32M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
[mysqldump]
quick
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]
open_files_limit = 8193
10
http://neoclova.co.kr/
2.3.4 systemd 설정 (service 등록)
neoclova@ubuntu:/usr/local$ sudo vi /etc/systemd/system/mariadb.service
neoclova@ubuntu:~$ sudo systemctl daemon-reload
[Unit]
Description=mariadb
After=network.target
[Service]
Type=forking
User=maria
Group=dba
LimitNOFILE=infinity
ExecStart=/usr/local/mariadb/support-files/mysql.server start
ExecStop=/usr/local/mariadb/support-files/mysql.server stop
[Install]
WantedBy=multi-user.target
2.3.5 사용자 권한 부여
neoclova@ubuntu:/usr/local$ sudo vi /etc/sudoers
maria ALL=NOPASSWD:/usr/bin/systemctl start mariadb.service, /usr/bin/systemctl stop mariadb.service, /usr/b
in/systemctl start mariadb.service, /usr/bin/systemctl restart mariadb.service
2.3.6 libaio 패키지 설치
neoclova@ubuntu:/usr/local$ sudo apt-get install libaio1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libaio1
0 upgraded, 1 newly installed, 0 to remove and 83 not upgraded.
Need to get 7,184 B of archives.
After this operation, 35.8 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu focal/main amd64 libaio1 amd64 0.3.112-5 [7,184 B]
Fetched 7,184 B in 1s (5,970 B/s)
Selecting previously unselected package libaio1:amd64.
(Reading database ... 158489 files and directories currently installed.)
Preparing to unpack .../libaio1_0.3.112-5_amd64.deb ...
Unpacking libaio1:amd64 (0.3.112-5) ...
Setting up libaio1:amd64 (0.3.112-5) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
11
http://neoclova.co.kr/
2.3.7 MariaDB install DB (initialize)
neoclova@ubuntu:/usr/local$ cd /usr/local/mariadb
neoclova@ubuntu:/usr/local/mariadb$ sudo ./scripts/mariadb-install-db --user=maria --def
aults-file=/etc/my.cnf --basedir=/usr/local/mariadb
Installing MariaDB/MySQL system tables in '/maria_data' ...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
Two all-privilege accounts were created.
One is root@localhost, it has no password, but you need to
be system 'root' user to connect. Use, for example, sudo mysql
The second is maria@localhost, it has no password either, but
you need to be the system 'maria' user to connect.
After connecting you can set the password, if you would need to be
able to connect as any of these users with a password and without sudo
See the MariaDB Knowledgebase at https://mariadb.com/kb
You can start the MariaDB daemon with:
cd '/usr/local/mariadb' ; /usr/local/mariadb/bin/mysqld_safe --datadir='/maria_data'
You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/local/mariadb/mysql-test' ; perl mysql-test-run.pl
Please report any problems at https://mariadb.org/jira
The latest information about MariaDB is available at https://mariadb.org/.
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
2.4 MariaDB 시작 / 접속 / 종료
2.4.1 MariaDB 시작
neoclova@ubuntu:~$ sudo systemctl start mariadb
neoclova@ubuntu:~$ sudo systemctl status mariadb
● mariadb.service - mariadb
Loaded: loaded (/etc/systemd/system/mariadb.service; disabled; vendor preset: enabled)
Active: active (running) since Tue 2022-04-05 21:12:43 PDT; 1min 52s ago
Process: 4613 ExecStart=/usr/local/mariadb/support-files/mysql.server start (code=exited, status=0/SU>
Main PID: 4777 (mysqld_safe)
Tasks: 11 (limit: 4588)
Memory: 115.6M
CGroup: /system.slice/mariadb.service
├─4777 /bin/sh /usr/local/mariadb/bin/mysqld_safe --datadir=/maria_data --pid-file=/maria_da>
└─5021 /usr/local/mariadb/bin/mariadbd --basedir=/usr/local/mariadb --datadir=/maria_data -->
12
http://neoclova.co.kr/
Apr 05 21:12:42 ubuntu systemd[1]: Starting mariadb...
Apr 05 21:12:42 ubuntu mysql.server[4613]: Starting MariaDB
Apr 05 21:12:42 ubuntu mysql.server[4613]: .
Apr 05 21:12:42 ubuntu mysql.server[4777]: 220405 21:12:42 mysqld_safe Logging to '/maria_log/mysql.err'.
Apr 05 21:12:42 ubuntu mysql.server[4777]: 220405 21:12:42 mysqld_safe Starting mariadbd daemon with data>
Apr 05 21:12:43 ubuntu mysql.server[4613]: *
Apr 05 21:12:43 ubuntu systemd[1]: Started mariadb.
2.4.2 Secure installation
neoclova@ubuntu:/$ cd /usr/local/mariadb/bin/
neoclova@ubuntu:/usr/local/mariadb/bin$ sudo ./mariadb-secure-installation --basedir=/us
r/local/mariadb
● 에러 발생시 해결 후 재시도
/usr/local/mariadb/bin/mariadb: error while loading shared libraries: libncurses
.so.5: cannot open shared object file: No such file or directory
sudo find / -name "libncurses.so.*"
sudo ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6.2 /usr/lib/x86_64-linux-gnu/l
ibtinfo.so.5
sudo ln -s /usr/lib/x86_64-linux-gnu/libncurses.so.6.2 /usr/lib/x86_64-linux-gnu
/libncurses.so.5
print: /usr/local/mariadb/bin/my_print_defaults
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.
You already have your root account protected, so you can safely answer 'n'.
13
http://neoclova.co.kr/
Switch to unix_socket authentication [Y/n] y
Enabled successfully!
Reloading privilege tables..
... Success!
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
14
http://neoclova.co.kr/
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
2.4.3 Bash Shell 설정 / MariaDB 접속
neoclova@ubuntu:/usr/local/mariadb$ sudo passwd maria
New password:
Retype new password:
passwd: password updated successfully
$
쉘변경
$ chsh -s /bin/bash
계정 재로그인
neoclova@ubuntu:~$ su – maria
maria@ubuntu:~$
bash shell 설정
maria@ubuntu:~$ vi .bash_profile
maria@ubuntu:~$ . .bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mariadb/bin
maria@ubuntu:~$ sudo systemctl status mariadb
MariaDB [(none)]> status
--------------
mysql Ver 15.1 Distrib 10.7.3-MariaDB, for linux-systemd (x86_64) using readline 5.1
Connection id: 14
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server: MariaDB
Server version: 10.7.3-MariaDB-log MariaDB Server
Protocol version: 10
Connection: Localhost via UNIX socket
15
http://neoclova.co.kr/
Server characterset: utf8mb3
Db characterset: utf8mb3
Client characterset: utf8mb3
Conn. characterset: utf8mb3
UNIX socket: /tmp/mysql.sock
Uptime: 2 hours 10 min 8 sec
Threads: 1 Questions: 26 Slow queries: 0 Opens: 21 Open tables: 14 Queries per seco
nd avg: 0.003
----------------------------
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.001 sec)
MariaDB [(none)]> select user, host, authentication_string from mysql.user;
+-------------+-----------+-------------------------------------------+
| User | Host | authentication_string |
+-------------+-----------+-------------------------------------------+
| mariadb.sys | localhost | |
| root | localhost | *4557CF5E70B04EE24CCCF4E13EFCB290BE17E57E |
| maria | localhost | invalid |
+-------------+-----------+-------------------------------------------+
3 rows in set (0.003 sec)
MariaDB [(none)]> exit
Bye
2.5 추가 설정
2.5.1 Linux limit 설정
https://mariadb.com/kb/en/configuring-linux-for-mariadb/
neoclova@ubuntu:~$ sudo vi /etc/security/limits.conf
maria soft nofile 65536
maria hard nofile 65536
16
http://neoclova.co.kr/
2.5.2 swap 설정
neoclova@ubuntu:~$ sudo vi /etc/sysctl.conf
vm.swappiness=1
neoclova@ubuntu:~$ sudo cat /proc/sys/vm/swappiness

More Related Content

What's hot

J Ruby On Rails Presentation
J Ruby On Rails PresentationJ Ruby On Rails Presentation
J Ruby On Rails Presentation
railsconf
 
Mysql wp cluster_quickstart_windows
Mysql wp cluster_quickstart_windowsMysql wp cluster_quickstart_windows
Mysql wp cluster_quickstart_windows
Rogério Rocha
 
My sql monitoring cu沙龙
My sql monitoring cu沙龙My sql monitoring cu沙龙
My sql monitoring cu沙龙
colderboy17
 

What's hot (20)

Curso de MySQL 5.7
Curso de MySQL 5.7Curso de MySQL 5.7
Curso de MySQL 5.7
 
Instalar MySQL CentOS
Instalar MySQL CentOSInstalar MySQL CentOS
Instalar MySQL CentOS
 
J Ruby On Rails Presentation
J Ruby On Rails PresentationJ Ruby On Rails Presentation
J Ruby On Rails Presentation
 
MySQL Monitoring 101
MySQL Monitoring 101MySQL Monitoring 101
MySQL Monitoring 101
 
Linux configer
Linux configerLinux configer
Linux configer
 
Habilitar repositorio EPEL RHEL
Habilitar repositorio EPEL RHELHabilitar repositorio EPEL RHEL
Habilitar repositorio EPEL RHEL
 
Hadoop Cluster - Basic OS Setup Insights
Hadoop Cluster - Basic OS Setup InsightsHadoop Cluster - Basic OS Setup Insights
Hadoop Cluster - Basic OS Setup Insights
 
NoSQL атакует: JSON функции в MySQL сервере.
NoSQL атакует: JSON функции в MySQL сервере.NoSQL атакует: JSON функции в MySQL сервере.
NoSQL атакует: JSON функции в MySQL сервере.
 
Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesUsage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP Languages
 
Mysql wp cluster_quickstart_windows
Mysql wp cluster_quickstart_windowsMysql wp cluster_quickstart_windows
Mysql wp cluster_quickstart_windows
 
Usage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxUsage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on Linux
 
Install oracle11gr2 rhel5
Install oracle11gr2 rhel5Install oracle11gr2 rhel5
Install oracle11gr2 rhel5
 
Authen Free Bsd6 2
Authen Free Bsd6 2Authen Free Bsd6 2
Authen Free Bsd6 2
 
HADOOP 실제 구성 사례, Multi-Node 구성
HADOOP 실제 구성 사례, Multi-Node 구성HADOOP 실제 구성 사례, Multi-Node 구성
HADOOP 실제 구성 사례, Multi-Node 구성
 
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
Vmlinux: anatomy of bzimage and how x86 64 processor is bootedVmlinux: anatomy of bzimage and how x86 64 processor is booted
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
 
MySQL Replication: Demo Réplica en Español
MySQL Replication: Demo Réplica en EspañolMySQL Replication: Demo Réplica en Español
MySQL Replication: Demo Réplica en Español
 
Architecting cloud
Architecting cloudArchitecting cloud
Architecting cloud
 
My sql monitoring cu沙龙
My sql monitoring cu沙龙My sql monitoring cu沙龙
My sql monitoring cu沙龙
 
Linux Server Hardening - Steps by Steps
Linux Server Hardening - Steps by StepsLinux Server Hardening - Steps by Steps
Linux Server Hardening - Steps by Steps
 
Component pack 6006 install guide
Component pack 6006 install guideComponent pack 6006 install guide
Component pack 6006 install guide
 

Similar to MariaDB10.7_install_Ubuntu.docx

Percona Cluster Installation with High Availability
Percona Cluster Installation with High AvailabilityPercona Cluster Installation with High Availability
Percona Cluster Installation with High Availability
Ram Gautam
 
Creating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server HardeningCreating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server Hardening
archwisp
 
Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册
Yiwei Ma
 

Similar to MariaDB10.7_install_Ubuntu.docx (20)

MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)
 
Asian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On UblAsian Spirit 3 Day Dba On Ubl
Asian Spirit 3 Day Dba On Ubl
 
MySQL for Beginners - part 1
MySQL for Beginners - part 1MySQL for Beginners - part 1
MySQL for Beginners - part 1
 
Multiple instances on linux
Multiple instances on linuxMultiple instances on linux
Multiple instances on linux
 
Multiple instances second method
Multiple instances second methodMultiple instances second method
Multiple instances second method
 
OTRS
OTRSOTRS
OTRS
 
Less passwords, more security: unix socket authentication and other MariaDB h...
Less passwords, more security: unix socket authentication and other MariaDB h...Less passwords, more security: unix socket authentication and other MariaDB h...
Less passwords, more security: unix socket authentication and other MariaDB h...
 
MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017
 
TrinityCore server install guide
TrinityCore server install guideTrinityCore server install guide
TrinityCore server install guide
 
Setting up mongodb sharded cluster in 30 minutes
Setting up mongodb sharded cluster in 30 minutesSetting up mongodb sharded cluster in 30 minutes
Setting up mongodb sharded cluster in 30 minutes
 
Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...
Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...
Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replication
 
Install tomcat 5.5 in debian os and deploy war file
Install tomcat 5.5 in debian os and deploy war fileInstall tomcat 5.5 in debian os and deploy war file
Install tomcat 5.5 in debian os and deploy war file
 
Network Manual
Network ManualNetwork Manual
Network Manual
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linux
 
Percona Cluster Installation with High Availability
Percona Cluster Installation with High AvailabilityPercona Cluster Installation with High Availability
Percona Cluster Installation with High Availability
 
Writing & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp BostonWriting & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp Boston
 
Creating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server HardeningCreating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server Hardening
 
Mysql ppt
Mysql pptMysql ppt
Mysql ppt
 
Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册
 

More from NeoClova

More from NeoClova (16)

MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11
 
MySQL_MariaDB로의_전환_기술요소-202212.pptx
MySQL_MariaDB로의_전환_기술요소-202212.pptxMySQL_MariaDB로의_전환_기술요소-202212.pptx
MySQL_MariaDB로의_전환_기술요소-202212.pptx
 
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docxKeepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
 
MySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptxMySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptx
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx
 
MySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxMySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docx
 
Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기
 
Maxscale 소개 1.1.1
Maxscale 소개 1.1.1Maxscale 소개 1.1.1
Maxscale 소개 1.1.1
 
Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼
 
MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
 
MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바MySQL Administrator 2021 - 네오클로바
MySQL Administrator 2021 - 네오클로바
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바
 
redis 소개자료 - 네오클로바
redis 소개자료 - 네오클로바redis 소개자료 - 네오클로바
redis 소개자료 - 네오클로바
 
Percona server for MySQL 제품 소개
Percona server for MySQL 제품 소개Percona server for MySQL 제품 소개
Percona server for MySQL 제품 소개
 
MariaDB 제품 소개
MariaDB 제품 소개MariaDB 제품 소개
MariaDB 제품 소개
 

Recently uploaded

一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单
一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单
一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单
aqpto5bt
 
原件一样伦敦国王学院毕业证成绩单留信学历认证
原件一样伦敦国王学院毕业证成绩单留信学历认证原件一样伦敦国王学院毕业证成绩单留信学历认证
原件一样伦敦国王学院毕业证成绩单留信学历认证
pwgnohujw
 
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
q6pzkpark
 
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
jk0tkvfv
 
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotecAbortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
一比一原版(Monash毕业证书)莫纳什大学毕业证原件一模一样
一比一原版(Monash毕业证书)莫纳什大学毕业证原件一模一样一比一原版(Monash毕业证书)莫纳什大学毕业证原件一模一样
一比一原版(Monash毕业证书)莫纳什大学毕业证原件一模一样
yhavx
 
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
zifhagzkk
 
obat aborsi Banjarmasin wa 082135199655 jual obat aborsi cytotec asli di Ban...
obat aborsi Banjarmasin wa 082135199655 jual obat aborsi cytotec asli di  Ban...obat aborsi Banjarmasin wa 082135199655 jual obat aborsi cytotec asli di  Ban...
obat aborsi Banjarmasin wa 082135199655 jual obat aborsi cytotec asli di Ban...
siskavia95
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
acoha1
 
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
yulianti213969
 
Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...
Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...
Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...
Obat Aborsi 088980685493 Jual Obat Aborsi
 
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
varanasisatyanvesh
 

Recently uploaded (20)

Seven tools of quality control.slideshare
Seven tools of quality control.slideshareSeven tools of quality control.slideshare
Seven tools of quality control.slideshare
 
一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单
一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单
一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单
 
原件一样伦敦国王学院毕业证成绩单留信学历认证
原件一样伦敦国王学院毕业证成绩单留信学历认证原件一样伦敦国王学院毕业证成绩单留信学历认证
原件一样伦敦国王学院毕业证成绩单留信学历认证
 
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
 
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
 
Las implicancias del memorándum de entendimiento entre Codelco y SQM según la...
Las implicancias del memorándum de entendimiento entre Codelco y SQM según la...Las implicancias del memorándum de entendimiento entre Codelco y SQM según la...
Las implicancias del memorándum de entendimiento entre Codelco y SQM según la...
 
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarjSCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
 
The Significance of Transliteration Enhancing
The Significance of Transliteration EnhancingThe Significance of Transliteration Enhancing
The Significance of Transliteration Enhancing
 
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotecAbortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
 
一比一原版(Monash毕业证书)莫纳什大学毕业证原件一模一样
一比一原版(Monash毕业证书)莫纳什大学毕业证原件一模一样一比一原版(Monash毕业证书)莫纳什大学毕业证原件一模一样
一比一原版(Monash毕业证书)莫纳什大学毕业证原件一模一样
 
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
 
Chapter 1 - Introduction to Data Mining Concepts and Techniques.pptx
Chapter 1 - Introduction to Data Mining Concepts and Techniques.pptxChapter 1 - Introduction to Data Mining Concepts and Techniques.pptx
Chapter 1 - Introduction to Data Mining Concepts and Techniques.pptx
 
obat aborsi Banjarmasin wa 082135199655 jual obat aborsi cytotec asli di Ban...
obat aborsi Banjarmasin wa 082135199655 jual obat aborsi cytotec asli di  Ban...obat aborsi Banjarmasin wa 082135199655 jual obat aborsi cytotec asli di  Ban...
obat aborsi Banjarmasin wa 082135199655 jual obat aborsi cytotec asli di Ban...
 
Predictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesPredictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting Techniques
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
 
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
 
Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...
Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...
Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...
 
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
 
社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 

MariaDB10.7_install_Ubuntu.docx

  • 3. 3 http://neoclova.co.kr/ 개정이력 버전 변경일 변경사유1 변경내용2 작성자 승인자 Ver. 1.0 2022.03.21 최초작성 문서 최초 작성 오혜린 1 변경 사유: 변경 내용이 이전 문서에 대해 최초작성/승인/추가/수정/삭제 중 선택 기입 2 변경 내용: 변경이 발생되는 위치와 변경 내용을 자세히 기록(장.절과 변경 내용을 기술한다.)
  • 4. 4 http://neoclova.co.kr/ 목차 1. About MariaDB 4 1.1 5 1.2 5 1.3 5 2. 설치 5 2.1 6 2.2 6 2.3 7 2.4 11 2.5 15
  • 5. 5 http://neoclova.co.kr/ 1. About MariaDB 1.1 MariaDB 개요 MariaDB는 전세계적으로 가장 널리 사용되고 있는 Open Source Database System인 MySQL 과의 호 환성을 가지면서 추가적인 기능들을 개발하여 배포/판매하고 있는 데이터베이스이다. 2009년 initial r elease를 했다. 1.2 MariaDB as a R-DBMS 관계형 데이터베이스는 데이터를 하나의 커다란 저장 공간에 저장하지 않고 서로 별개의 테이블에 나 누어서 저장을 하는 시스템이다. 이를 통해 처리 속도와 유연성이 확보된다. SQL은 “Structured Query language”의 약자이며, SQL은 ANSI/ISO 표준에서 정의한 데이터베이스 접속을 위한 가장 일반적인 표준 언어이다. 이 매뉴얼에서 언급하는 “SQL 표준”은 각 시점에서 발표된 SQL표준을 의미하는 것이 다. 1.3 Open Source Database System MariaDB 데이터베이스는 GPL(GNU Public License)을 준수하는 오픈 소스 데이터베이스이며, GPL을 준수해서 사용하는 모든 사용자에게 무료로 배포되고 있다. http://mariadb.org/ http://mariadb.com/
  • 6. 6 http://neoclova.co.kr/ 2. 설치 2.1 설치 기본 정보 항목 값 OS version Ubuntu 20.04.4 LTS OS user maria ( 초기 root OS계정 : neoclova ) MariaDB version MariaDB 10.7.3 Base directory /usr/local/mariadb Data directory /maria_data Log directory /maria_log 2.2 설치 준비 2.2.1 SSH 접속 설정 openssh-server 설치 (설치가 완료된 후, SSH서비스 자동시작. 상태확인) neoclova@ubuntu:~$ sudo apt update neoclova@ubuntu:~$ sudo apt install openssh-server neoclova@ubuntu:~$ sudo systemctl status ssh UFW 방화벽 시스템에서 SSH 포트 open neoclova@ubuntu:~$ sudo ufw allow ssh XShell등 외부에서 ssh 접속 테스트 ssh 계정명@ip주소 형태 2.2.2 OS 계정 생성
  • 7. 7 http://neoclova.co.kr/ neoclova@ubuntu:~$ sudo groupadd dba neoclova@ubuntu:~$ sudo useradd maria -g dba -m neoclova@ubuntu:~$ cat /etc/group | grep dba dba:x:1001: neoclova@ubuntu:~$ cat /etc/passwd | grep maria maria:x:1001:1001::/home/maria:/bin/sh 2.2.3 디렉토리 생성 neoclova@ubuntu:/$ sudo mkdir /maria_data /maria_log 2.2.4 MariaDB Download https://mariadb.org/download/ https://archive.mariadb.org/ neoclova@ubuntu:/$ cd /usr/local neoclova@ubuntu:/usr/local$ sudo wget https://mirror.yongbok.net/mariadb/mariadb-10.7.3/ bintar-linux-systemd-x86_64/mariadb-10.7.3-linux-systemd-x86_64.tar.gz neoclova@ubuntu:/usr/local$ ls -lah mariadb-10.7.3-linux-systemd-x86_64.tar.gz -rw-r--r-- 1 root root 331M Feb 11 15:48 mariadb-10.7.3-linux-systemd-x86_64.tar.gz 2.3 MariaDB 설치 2.3.1 MariaDB 엔진 설치 (tar 압축 해제 / 심볼릭 링크 / chown 설정) neoclova@ubuntu:/usr/local$ sudo tar -zxf mariadb-10.7.3-linux-systemd-x86_64.tar.gz neoclova@ubuntu:/usr/local$ sudo ln -s mariadb-10.7.3-linux-systemd-x86_64 mariadb neoclova@ubuntu:/usr/local$ sudo chown -R maria.dba /maria_data neoclova@ubuntu:/usr/local$ sudo chown -R maria.dba /maria_log neoclova@ubuntu:/usr/local$ sudo chown -R maria.dba maria* neoclova@ubuntu:/usr/local$ ls -lah maria* lrwxrwxrwx 1 maria dba 35 Apr 5 20:19 mariadb -> mariadb-10.7.3-linux-systemd-x86_64 -rw-r--r-- 1 maria dba 331M Feb 11 15:48 mariadb-10.7.3-linux-systemd-x86_64.tar.gz mariadb-10.7.3-linux-systemd-x86_64: total 192K
  • 8. 8 http://neoclova.co.kr/ drwxrwxr-x 11 maria dba 4.0K Feb 11 15:47 . drwxr-xr-x 11 root root 4.0K Apr 5 20:19 .. drwxr-xr-x 2 maria dba 4.0K Jan 18 09:31 bin -rw-r--r-- 1 maria dba 18K Feb 10 12:33 COPYING -rw-r--r-- 1 maria dba 2.1K Feb 10 12:33 CREDITS drwxrwxr-x 3 maria dba 4.0K Feb 10 13:11 include -rw-r--r-- 1 maria dba 8.6K Feb 10 12:33 INSTALL-BINARY drwxr-xr-x 5 maria dba 4.0K Jan 18 09:31 lib drwxrwxr-x 5 maria dba 4.0K Feb 10 13:12 man drwxrwxr-x 9 maria dba 4.0K Feb 10 13:12 mysql-test -rw-r--r-- 1 maria dba 2.7K Feb 10 12:33 README.md -rw-r--r-- 1 maria dba 20K Feb 10 12:33 README-wsrep drwxrwxr-x 2 maria dba 4.0K Feb 10 13:12 scripts drwxrwxr-x 31 maria dba 4.0K Feb 10 13:12 share drwxrwxr-x 4 maria dba 4.0K Feb 10 13:12 sql-bench drwxrwxr-x 4 maria dba 4.0K Feb 10 13:12 support-files -rw-r--r-- 1 maria dba 85K Feb 10 12:33 THIRDPARTY 2.3.2 mysql.server 파일 수정 neoclova@ubuntu:/usr/local$ sudo vi /usr/local/mariadb/support-files/mysql.server basedir=/usr/local/mariadb datadir=/maria_data 2.3.3 my.cnf 설정 neoclova@ubuntu:/usr/local$ sudo vi /etc/my.cnf [client] port = 3306 socket = /tmp/mysql.sock [mysqld] user = maria port = 3306 socket = /tmp/mysql.sock basedir = /usr/local/mariadb datadir = /maria_data #Log file setting log-error = /maria_log/mysql.err slow_query_log = 1 slow_query_log_file = /maria_log/mysql-slow-query.log long_query_time = 3 #Time-out setting wait_timeout = 28800 interactive_timeout = 600
  • 9. 9 http://neoclova.co.kr/ # transaction isolation setting transaction_isolation = READ-COMMITTED # etc base setting back_log = 1024 max_connections = 1024 max_connect_errors = 1024 table_open_cache = 2048 max_allowed_packet = 16M max_heap_table_size = 1024M sort_buffer_size = 2M join_buffer_size = 2M thread_cache_size = 8 tmp_table_size = 1024M init_connect = "SET collation_connection = utf8_general_ci" init_connect = "SET NAMES utf8" character-set-server = utf8 innodb_lock_wait_timeout = 50 innodb_file_per_table innodb_thread_sleep_delay = 0 innodb_commit_concurrency = 36 innodb_doublewrite = 0 innodb_flush_log_at_trx_commit = 2 innodb_thread_concurrency = 36 innodb_log_files_in_group = 3 innodb_data_file_path = ibdata1:1024M:autoextend innodb_log_file_size = 256M innodb_buffer_pool_size = 4G innodb_log_buffer_size = 32M innodb_change_buffering=none key_buffer_size = 32M read_buffer_size = 2M read_rnd_buffer_size = 16M bulk_insert_buffer_size = 64M myisam_sort_buffer_size = 128M myisam_max_sort_file_size = 10G myisam_repair_threads = 1 [mysqldump] quick [mysqlhotcopy] interactive-timeout [mysqld_safe] open_files_limit = 8193
  • 10. 10 http://neoclova.co.kr/ 2.3.4 systemd 설정 (service 등록) neoclova@ubuntu:/usr/local$ sudo vi /etc/systemd/system/mariadb.service neoclova@ubuntu:~$ sudo systemctl daemon-reload [Unit] Description=mariadb After=network.target [Service] Type=forking User=maria Group=dba LimitNOFILE=infinity ExecStart=/usr/local/mariadb/support-files/mysql.server start ExecStop=/usr/local/mariadb/support-files/mysql.server stop [Install] WantedBy=multi-user.target 2.3.5 사용자 권한 부여 neoclova@ubuntu:/usr/local$ sudo vi /etc/sudoers maria ALL=NOPASSWD:/usr/bin/systemctl start mariadb.service, /usr/bin/systemctl stop mariadb.service, /usr/b in/systemctl start mariadb.service, /usr/bin/systemctl restart mariadb.service 2.3.6 libaio 패키지 설치 neoclova@ubuntu:/usr/local$ sudo apt-get install libaio1 Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: libaio1 0 upgraded, 1 newly installed, 0 to remove and 83 not upgraded. Need to get 7,184 B of archives. After this operation, 35.8 kB of additional disk space will be used. Get:1 http://us.archive.ubuntu.com/ubuntu focal/main amd64 libaio1 amd64 0.3.112-5 [7,184 B] Fetched 7,184 B in 1s (5,970 B/s) Selecting previously unselected package libaio1:amd64. (Reading database ... 158489 files and directories currently installed.) Preparing to unpack .../libaio1_0.3.112-5_amd64.deb ... Unpacking libaio1:amd64 (0.3.112-5) ... Setting up libaio1:amd64 (0.3.112-5) ... Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
  • 11. 11 http://neoclova.co.kr/ 2.3.7 MariaDB install DB (initialize) neoclova@ubuntu:/usr/local$ cd /usr/local/mariadb neoclova@ubuntu:/usr/local/mariadb$ sudo ./scripts/mariadb-install-db --user=maria --def aults-file=/etc/my.cnf --basedir=/usr/local/mariadb Installing MariaDB/MySQL system tables in '/maria_data' ... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system Two all-privilege accounts were created. One is root@localhost, it has no password, but you need to be system 'root' user to connect. Use, for example, sudo mysql The second is maria@localhost, it has no password either, but you need to be the system 'maria' user to connect. After connecting you can set the password, if you would need to be able to connect as any of these users with a password and without sudo See the MariaDB Knowledgebase at https://mariadb.com/kb You can start the MariaDB daemon with: cd '/usr/local/mariadb' ; /usr/local/mariadb/bin/mysqld_safe --datadir='/maria_data' You can test the MariaDB daemon with mysql-test-run.pl cd '/usr/local/mariadb/mysql-test' ; perl mysql-test-run.pl Please report any problems at https://mariadb.org/jira The latest information about MariaDB is available at https://mariadb.org/. Consider joining MariaDB's strong and vibrant community: https://mariadb.org/get-involved/ 2.4 MariaDB 시작 / 접속 / 종료 2.4.1 MariaDB 시작 neoclova@ubuntu:~$ sudo systemctl start mariadb neoclova@ubuntu:~$ sudo systemctl status mariadb ● mariadb.service - mariadb Loaded: loaded (/etc/systemd/system/mariadb.service; disabled; vendor preset: enabled) Active: active (running) since Tue 2022-04-05 21:12:43 PDT; 1min 52s ago Process: 4613 ExecStart=/usr/local/mariadb/support-files/mysql.server start (code=exited, status=0/SU> Main PID: 4777 (mysqld_safe) Tasks: 11 (limit: 4588) Memory: 115.6M CGroup: /system.slice/mariadb.service ├─4777 /bin/sh /usr/local/mariadb/bin/mysqld_safe --datadir=/maria_data --pid-file=/maria_da> └─5021 /usr/local/mariadb/bin/mariadbd --basedir=/usr/local/mariadb --datadir=/maria_data -->
  • 12. 12 http://neoclova.co.kr/ Apr 05 21:12:42 ubuntu systemd[1]: Starting mariadb... Apr 05 21:12:42 ubuntu mysql.server[4613]: Starting MariaDB Apr 05 21:12:42 ubuntu mysql.server[4613]: . Apr 05 21:12:42 ubuntu mysql.server[4777]: 220405 21:12:42 mysqld_safe Logging to '/maria_log/mysql.err'. Apr 05 21:12:42 ubuntu mysql.server[4777]: 220405 21:12:42 mysqld_safe Starting mariadbd daemon with data> Apr 05 21:12:43 ubuntu mysql.server[4613]: * Apr 05 21:12:43 ubuntu systemd[1]: Started mariadb. 2.4.2 Secure installation neoclova@ubuntu:/$ cd /usr/local/mariadb/bin/ neoclova@ubuntu:/usr/local/mariadb/bin$ sudo ./mariadb-secure-installation --basedir=/us r/local/mariadb ● 에러 발생시 해결 후 재시도 /usr/local/mariadb/bin/mariadb: error while loading shared libraries: libncurses .so.5: cannot open shared object file: No such file or directory sudo find / -name "libncurses.so.*" sudo ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6.2 /usr/lib/x86_64-linux-gnu/l ibtinfo.so.5 sudo ln -s /usr/lib/x86_64-linux-gnu/libncurses.so.6.2 /usr/lib/x86_64-linux-gnu /libncurses.so.5 print: /usr/local/mariadb/bin/my_print_defaults NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and haven't set the root password yet, you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password or using the unix_socket ensures that nobody can log into the MariaDB root user without the proper authorisation. You already have your root account protected, so you can safely answer 'n'.
  • 13. 13 http://neoclova.co.kr/ Switch to unix_socket authentication [Y/n] y Enabled successfully! Reloading privilege tables.. ... Success! You already have your root account protected, so you can safely answer 'n'. Change the root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] y ... Success! Cleaning up...
  • 14. 14 http://neoclova.co.kr/ All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! 2.4.3 Bash Shell 설정 / MariaDB 접속 neoclova@ubuntu:/usr/local/mariadb$ sudo passwd maria New password: Retype new password: passwd: password updated successfully $ 쉘변경 $ chsh -s /bin/bash 계정 재로그인 neoclova@ubuntu:~$ su – maria maria@ubuntu:~$ bash shell 설정 maria@ubuntu:~$ vi .bash_profile maria@ubuntu:~$ . .bash_profile PATH=$PATH:$HOME/bin:/usr/local/mariadb/bin maria@ubuntu:~$ sudo systemctl status mariadb MariaDB [(none)]> status -------------- mysql Ver 15.1 Distrib 10.7.3-MariaDB, for linux-systemd (x86_64) using readline 5.1 Connection id: 14 Current database: Current user: root@localhost SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server: MariaDB Server version: 10.7.3-MariaDB-log MariaDB Server Protocol version: 10 Connection: Localhost via UNIX socket
  • 15. 15 http://neoclova.co.kr/ Server characterset: utf8mb3 Db characterset: utf8mb3 Client characterset: utf8mb3 Conn. characterset: utf8mb3 UNIX socket: /tmp/mysql.sock Uptime: 2 hours 10 min 8 sec Threads: 1 Questions: 26 Slow queries: 0 Opens: 21 Open tables: 14 Queries per seco nd avg: 0.003 ---------------------------- MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.001 sec) MariaDB [(none)]> select user, host, authentication_string from mysql.user; +-------------+-----------+-------------------------------------------+ | User | Host | authentication_string | +-------------+-----------+-------------------------------------------+ | mariadb.sys | localhost | | | root | localhost | *4557CF5E70B04EE24CCCF4E13EFCB290BE17E57E | | maria | localhost | invalid | +-------------+-----------+-------------------------------------------+ 3 rows in set (0.003 sec) MariaDB [(none)]> exit Bye 2.5 추가 설정 2.5.1 Linux limit 설정 https://mariadb.com/kb/en/configuring-linux-for-mariadb/ neoclova@ubuntu:~$ sudo vi /etc/security/limits.conf maria soft nofile 65536 maria hard nofile 65536
  • 16. 16 http://neoclova.co.kr/ 2.5.2 swap 설정 neoclova@ubuntu:~$ sudo vi /etc/sysctl.conf vm.swappiness=1 neoclova@ubuntu:~$ sudo cat /proc/sys/vm/swappiness