
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 currentpassword for the root user. If you've just installed MariaDB, andyou 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 MariaDBroot 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 installationgo a bit smoother. You should remove them before moving into aproduction environment.Remove anonymous users? [Y/n]
익명유저를 삭제하겠냐고 물어보는데 Y 엔터를 누릅니다.
... Success!Normally, root should only be allowed to connect from 'localhost'. Thisensures 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 canaccess. This is also intended only for testing, and should be removedbefore 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 farwill 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 MariaDBinstallation 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 55Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04Copyright (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;를 넣고 엔터치면 됩니다.
