MariaDB 개발하기

지난번 EC2서버에 MariaDB를 설정하는 것에 대해 정리를 했다.

 

이번에는 MariaDB를 개발하는 것에 대해 정리를 해보려한다.

 

1. MariaDB 생성하기

MetaCode라는 이름의 DB를 생성해봤다.

> create database MetaCode;

 

DB 사용자 계정 생성

(DB client를 이용하여 외부에서 접속하기 위해서는 %로 설정해야한다)

> create user metacode@localhost identified by '{password}';
> create user 'metacode'@'%' identified by '{password}';

 

생성된 계정에 권한 설정

> GRANT ALL PRIVILEGES ON MetaCode.* TO 'metacode'@'localhost';
> FLUSH PRIVILEGES;

 

 

추가된 계정 확인하기

MariaDB [MetaCode]> show databases;
+--------------------+
| Database           |
+--------------------+
| MetaCode           |
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
5 rows in set (0.000 sec)

MariaDB [MetaCode]> 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]> select Host, User from user;
+-----------+----------+
| Host      | User     |
+-----------+----------+
| localhost | metacode |
| localhost | root     |
+-----------+----------+
2 rows in set (0.000 sec)

 

 

 

 

관련 글

2021.12.17 - [Development/BackEnd] - AWS EC2 세팅하기 - MariaDB

728x90

'Development > DB' 카테고리의 다른 글

AWS EC2 세팅하기 - MariaDB  (0) 2021.12.17