HomeAbout Me

Ubuntu 20.04LTS에 MariaDB 설치하기

By Woosung
Published in Ubuntu
May 28, 2020
1 min read
Ubuntu 20.04LTS에 MariaDB 설치하기

MariaDB 설치하기

ghost 플랫폼이나 그누보드, 워드프레스에서는 데이터베이스 역할을 해주는 패키지가 필요합니다.

보통 Mysql로 대표되는데요. 요새는 MariaDB가 대세라서 깔아주겠습니다.

sudo apt install mariadb-server mariadb-client

위 명령어로 서버와 클라이언트를 깔아줍니다.

sudo mysql_secure_installation

위 명령어로 MariaDB를 설정해줍니다.

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
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):

위와 같은 내용이 나오는데, 처음이기 때문에 비번이 없어 그냥 엔터만 칩니다.

OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n]

위와 같이 나오는데 Y 엔터를 누릅니다.

그러면 root의 비번을 생성합니다. MariaDB 전용 root의 비번이기 때문에 꼭 기억하셔야 합니다.

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]

test DB가 있는데 삭제하는게 좋습니다. 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...
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!

이제 설정이 완료되었습니다.

sudo mysql -u root -p

위 명령어를 넣고 아까 설정한 root 비번을 넣으면 MariaDB로 접속할 수 있습니다.

Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 55
Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04
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)]>

위와 같이 접속된 것을 알 수 있습니다.

접속에서 나오려면 exit;를 넣고 엔터치면 됩니다.


Tags

Google CloudMariaDB

Share

Previous Article
Letsencrypt 와일드카드 인증서 발급받는 방법

Woosung

Woosung

반가워요!

우성군의 NAS를 운영하고 있는 우성짱입니다. 2013년부터 그누보드4 운영을 시작으로, 이제 정적사이트까지 만들게 되었습니다. 이런 신세계를 눈 앞에 볼 수 있다는 것이 정말 신기하고 재밌습니다.

Expertise

그누보드
Nginx
Server

Social Media

github홈페이지

Related Posts

Ubuntu 20.04 LTS에 PHP 7.4 설치 및 라이믹스 설치하기
Ubuntu
Ubuntu 20.04 LTS에 PHP 7.4 설치 및 라이믹스 설치하기
November 01, 2020
2 min
© 2026, All Rights Reserved.
Powered By
Vector created by pikisuperstar

Topics

GatsbyUbuntughostGnuboardGoogle Cloud

Social Media