본문 바로가기
Linux/CentOS

[CentOS] MariaDB 설치 및 MySQL Workbench

by 오송나라 2024. 4. 11.
728x90
SMALL
안녕하세요. 오송입니다.

 

오늘은 CentOS7에 MariaDB를 설치하고 Workbench까지 설치해보도록 하곘습니다.

 

천천히 따라오시면서 모르는 부분이 있으시면, 댓글 달아주시면 됩니다.


1.

STEP 1.0. MariaDB 설치

  • MariaDB를 설치하기 위해 아래 명령어 실행
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash

STEP 1.0.1. MariaDB yum으로 설치

  • yum 명령어로 MariaDB 서버 설치
  • 에러 발생 시에 --skip-broken으로 진행
yum install MariaDB-server

# 에러 발생 시
yum install MariaDB-server --skip-broken

STEP 1.0.2. MariaDB 설정

  • MariaDB 서비스 부팅시에 자동 실행 설정
systemctl enable mariadb
  • MariaDB 실행
systemctl start mariadb
  • MariaDB의 root 암호 및 기본 보안 설정
mysql_secure_installation
Enter current password for root (enter for none): 엔터 클릭

# root password를 지정하겠냐는 문구
Set root password? [Y/n] Y
# 패스워드 입력

# anoymous user를 삭제하겠냐는 문구
Remove anonymous users? [Y/n] Y
# 원격지에서 root 로그인 허용하겠냐는 문구
Disallow root login remotely? [Y/n] Y
#누구든지 access할 수 있는 DB를 삭제하겠냐는 문구
Remove test database and access to it? [Y/n] Y
#설정한 권한을 모두 리로드 후 적용하겠냐는 문구
Reload privilege tables now? [Y/n] Y

STEP 1.0.3. MariaDB 계정 생성

  • MariaDB 접속
mysql -u root -p
  • 계정 생성
create user '[userID]'@'%' identified by '[password]';
  • 권한 부여
grant all privileges on [userID].* to '[userID]'@'%';
flush privileges;

STEP 1.0.4. Workbench 프로그램 다운로드

https://dev.mysql.com/downloads/workbench/

 

MySQL :: Download MySQL Workbench

Select Operating System: Select Operating System… Microsoft Windows Ubuntu Linux Red Hat Enterprise Linux / Oracle Linux Fedora macOS Source Code Select OS Version: All Windows (x86, 64-bit) Recommended Download: Other Downloads: Windows (x86, 64-bit), M

dev.mysql.com

  • 설치 완료 후 + 클릭해서 Connections 생성

  • Connection Name 입력 ( 구분하기 편한 Name 입력)
  • Hostname에 CentOS의 IP 입력
  • Username은 DB 생성시에 만들었던 username 입력
  • Password에서 Store in Vault 클릭

  • DB 생성한 USER 계정의 Password 입력

  • 생성된 Connections 클릭

 

728x90
LIST

'Linux > CentOS' 카테고리의 다른 글

[CentOS] Tomcat 설치  (0) 2024.04.11
[CentOS] Apache 웹서버 설치  (0) 2024.04.11
[CentOS] 설치 및 보안조치  (2) 2024.04.03