깐죽이의 정보 바다

APM을 설치 했으면 mysql(MariaDB) 초기 설정 하겠습니다. 

MariaDB 특징

  • 관계형 데이터베이스 관리 시스템(RDBMS: Relational DataBase Management System)
  • MySQL과 동일한 소스 코드 기반 데이터베이스 이름만 다르고 명령어나 사용법은 같습니다. 
  • MariaDB는 MySQL보다  성능이 70% 뛰어납니다. 
  • GPL v2 라이센스

1. 기본설정

root 관리자 계정을 접속

[root@localhost lib]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.51 MySQL Community Server (GPL)

Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

초기 비번은 없기 때문에 그냥 엔터 치고 넘어가면 됩니다. 

 

Database 조회

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

mysql>

 

Database 생성

mysql> create database damuk;
Query OK, 1 row affected (0.00 sec)

 

Database 사용

mysql> use damuk;
Database changed

 

계정조회

mysql> select host, user, password from user;
+-----------------------+------+----------+
| host                  | user | password |
+-----------------------+------+----------+
| localhost             | root |          |
| localhost.localdomain | root |          |
| 127.0.0.1             | root |          |
| ::1                   | root |          |
| localhost             |      |          |
| localhost.localdomain |      |          |
+-----------------------+------+----------+
6 rows in set (0.00 sec)

 

계정생성

mysql> create user 'damuk' identified by '@#^$%^#$%^#$%ㅎ$%@ㅆ@@';
Query OK, 0 rows affected (0.00 sec)

 

계정조회

mysql> select host, user, password from user;
+-----------------------+-------+-------------------------------------------+
| host                  | user  | password                                  |
+-----------------------+-------+-------------------------------------------+
| localhost             | root  |                                           |
| localhost.localdomain | root  |                                           |
| 127.0.0.1             | root  |                                           |
| ::1                   | root  |                                           |
| localhost             |       |                                           |
| localhost.localdomain |       |                                           |
| %                     | damuk | *4921FF254610FFA4AE3EFF4D7773B0E9B7202F9E |
+-----------------------+-------+-------------------------------------------+
7 rows in set (0.00 sec)

 

schema, database 권한 부여

mysql> grant all privileges on damuk.* to '%' identified by 'damuk' with grant option;
Query OK, 0 rows affected (0.00 sec)

해당 유저에 해당 데이터베이스 권한을 부여 합니다. 

 

schema, database 권한 확인

mysql> show grants for 'damuk'@'%';
+------------------------------------------------------------------------------------------------------+
| Grants for damuk@%                                                                                   |
+------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'damuk'@'%' IDENTIFIED BY PASSWORD '*4921FF254610FFA4AE3EFF4D7773B0E9B7202F9E' |
| GRANT ALL PRIVILEGES ON `damuk`.* TO 'damuk'@'%' WITH GRANT OPTION                                   |
+------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

 

 

 

반응형

공유하기

facebook twitter kakaoTalk kakaostory naver band shouturl