새소식

MySQL & Maria

Maria DB Binary Install

  • -
반응형

Maria Binary Install

Maria DB나 MySQL DB는 설치하는데 있어 크게 차이가 없다.  

 

0.MariaDB Binary 파일

- maria DB는 아래 사이트에서 OS별로 다운로드 가능

https://downloads.mariadb.org/

 

1.User 생성

[root@mariadb ~ ] groupadd mysql
[root@mariadb ~ ] useradd -g mysql mysql

 

2.MariaDB Directory 생성 & tar 풀기 & 심볼릭 링크 설정

[root@mariadb ~] mkdir -p /maria/sw/
[root@mariadb:/maria/sw] tar -zxvf /media/mariadb-10.2.12-linux-x86_64.tar.gz
[root@mariadb:/maria/sw] ln -s mariadb-10.2.12-linux-x86_64 maria

 

3./etc/my.cnf 수정

##mysqld로 기동시 적용
[mysqld]
basedir=/maria/sw/maria   ## maria DB engine
datadir=/maria/data  ## Datafile
socket=/tmp/mysql.sock
log-error=/maria/log/mariadb.log  ## logfile
pid-file=/maria/pid/mariadb.pid  ## pidfile (process ID file)
innodb_buffer_pool_size = 2147483648 ## value is 50 to 75 percent of system memory
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

##mysqld_safe로 기동시 적용
[mysqld_safe]
log-error=/maria/log/mariadb.log  ## logfile
pid-file=/maria/pid/mariadb.pid  ## pidfile (process ID file)

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

 

4.Maria Directory 생성 & 권한 부여

- Maria DB의  Data & Log Directory 생성 및 권한 부여 (MySQL User 권한 ) 

[root@mariadb:/maria/sw/maria] cd /maria
[root@mariadb:/maria] mkdir log pid data
[root@mariadb:/maria] chown -R mysql:mysql log pid data

5.MariaDB Installing

[root@mariadb:/maria/sw/maria] ./scripts/mysql_install_db --user=mysql --basedir=/maria/sw/maria  
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

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'/maria/sw/maria/bin/mysqladmin' -u root password 'new-password'
'/maria/sw/maria/bin/mysqladmin' -u root -h mariadb password 'new-password'

Alternatively you can run:
'/maria/sw/maria/bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/maria/sw/maria' ; /maria/sw/maria/bin/mysqld_safe --datadir='/maria/data'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/maria/sw/maria/mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/=

6.Start MariaDB

[root@mariadb:/maria/sw/maria] ./bin/mysqld_safe --user=mysql  &

[root@mariadb:/maria/sw/maria/support-files] cp mysql.server /etc/init.d/mysqld 
[root@mariadb:/maria/sw/maria/support-files] /etc/init.d/mysqld start
Reloading systemd:                                         [  OK  ]
Starting mysqld (via systemctl):                           [  OK  ]

 

7.mysql_secure_installation  실행

root@mariadb:/root# mysql_secure_installation --basedir=/maria/sw/maria

1.Enter current password for root (enter for none): Enter -- 초기 설정시 없으므로 엔터

2.Set root password? [Y/n] Y    -- Root Password 설정 여부
  New password: root            -- 설정할 root password
  Re-enter new password: root   -- root password 재입력

3.Remove anonymous users? [Y/n] Y     -- 익명 사용자 제거

4.Disallow root login remotely? [Y/n] Y   -- Root User 외부 접속 허용

5.Remove test database and access to it? [Y/n] Y -- Test Database 제거

6.Reload privilege tables now? [Y/n] Y  -- 바로 적용할지

 

반응형

'MySQL & Maria' 카테고리의 다른 글

Slow Query 분석 Website  (0) 2021.08.24
[MySQL] RENAME DATABASE  (0) 2021.08.10
Query Cache  (1) 2021.08.05
MySQLTunner.pl - MySQL 성능 진단 툴  (0) 2021.08.05
MySQL 과도한 CPU 사용 Thread 확인 ( Pidstat )  (6) 2021.08.03
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.