설치환경 OS : macOS sonoma 14.6.1

mariadb 설치/접속

1. brew update

brew update
> Already up-to-date.  

2. brew로 mariadb 정보 확인

brew info mariadb
> ==> mariadb: stable 12.0.2 (bottled)
> 이하 생략

3. brew로 mariadb 설치

brew install mariadb

4. brew로 mariadb를 실행

brew services start mariadb
==> Successfully started `mariadb` (label: homebrew.mxcl.mariadb)

5. mariadb에 접속

mariadb

6. 현재 mariadb에 존재하는 데이터베이스를 출력

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| test               |
+--------------------+
 5 rows in set (0.005 sec)

7. mysql 데이터베이스를 선택

MariaDB [(none)]> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

MariaDB [(mysql)]>

8. mariadb 계정 정보 불러오기

MariaDB [mysql]> select host, user, password from user;
+------------------------+-------------+----------+
| Host                   | User        | Password |
+------------------------+-------------+----------+
| localhost              | mariadb.sys |          |
| localhost              | root        | invalid  |
| localhost              | juyoung     | invalid  |
| localhost              |             |          |
| juyoungui-macbookpro.local|            |          |
+------------------------+-------------+----------+
5 rows in set (0.003 sec)

9. 루트계정 비밀번호 변경/저장

  • ’test’ 자리에 원하는 비밀번호 입력하기
MariaDB [mysql]> set password for 'root'@'localhost'=password('test');
Query OK, 0 rows affected (0.009 sec)

MariaDB [mysql]> select host, user, password from user;
+------------------------+-------------+----------+
| Host                   | User        | Password |
+------------------------+-------------+----------+
| localhost              | mariadb.sys |          |
| localhost              | root        | *A4B6157319038724E3560894F7F932C8886EBFCF  |
| localhost              | juyoung     | invalid  |
| localhost              |             |          |
| juyoungui-macbookpro.local|            |          |
+------------------------+-------------+----------+
5 rows in set (0.003 sec)

10. mariadb 종료

MariaDB [mysql]> \q
Bye


brew services stop mariadb
Stopping `mariadb`... (might take a while)
==> Successfully stopped `mariadb` (label: homebrew.mxcl.mariadb)

참고자료

댓글남기기