프로그램/ETC

[MariaDB] Ubuntu MariaDB 설치 & 설정하기

프뚜 2024. 7. 3. 10:00
728x90
반응형
SMALL

안녕하세요.

우분투에 MariaDB(mysql)을 설치해보겠습니다.


우분투 서버 접속

1. mariadb server & client 설치하기

apt update -y
apt upgrade -y

apt install mariadb-server -y
apt install mariadb-client -y

클라이언트를 설치하면 몇가지 문의를 합니다. 묻지 않는다면,

mysql_secure_installation

을 실행하면 아래의 설정을 진행하게 됩니다.

 

2. mariadb client 설정하기

# root 비밀번호 입력
Enter current password for root (enter for none):

# root 비밀번호 변경 여부
Change the root password? [Y/n]

# anonymous 계정 삭제 여부
Remove anonymous users? [Y/n]

# test db 삭제 여부
Remove test database and access to it? [Y/n]

# 즉시 적용 여부
Reload privilege tables now?

원하는 설정에 맞춰서 설정하시면 됩니다.

 

3. mariadb 실행하기

# 활성화
systemctl enable mariadb
# 시작
systemctl start mariadb
# 상태 확인
systemctl status mariadb

# systemctl 명령어가 없다면
service mariadb start

정상적으로 설치 및 기본 설정이 완료되었습니다.

 

4. mariadb 접속하기

mysql -u root -p
Enter password:

2번의 설정했던 root 비밀번호를 입력합니다.


정상적으로 설치가 완료되었습니다.

728x90
반응형
LIST