성장에 목마른 코린이

[DB] MariaDB 설치, 세팅, 접속 (Mac) 본문

데이터베이스/MariaDB

[DB] MariaDB 설치, 세팅, 접속 (Mac)

성장하는 코린이 2022. 11. 23. 09:55
728x90
 

1. MariaDB 설치 (Mac)

brew install mariadb

mariadb 실행 및 중지

실행 : brew services start mariadb
중지 : brew services stop mariadb

 

mariadb를 동작하는지 확인

brew services list

2. MariaDB root 계정 생성

Mysql과 마찬가지로 MariaDB도 설치하였다면 관리자 계정인 root 계정을 설정해야합니다.

sudo mariadb-secure-installation

1. 자신의 Mac Password를 입력하면 됩니다.

2. MariaDB 세팅

중간에 패스워드는 입력안하면 다시 sudo mariadb-secure-installation 해야합니다.

저같은 경우엔 처음에 n 눌러서 세팅하고나니 접속이 안되더라고요.

(OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] n
... skipping.

You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] y
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] n
... skipping.

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] 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!

3. MariaDB root 계정에 접속

// mariadb는 mysql이랑 자매 데이터베이스라 이렇게 들어가면됩니다.
mysql -u root -p

입력 하셨으면, 2번에서 입력하셨던 password 입력해주시면 됩니다.

password입력 안하셨으면 접속 안되니 다시 2번 따라해주세요.

Comments