티스토리 뷰


$ mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]>


# 데이터베이스 생성
# https://mariadb.com/kb/en/library/create-database/
# CREATE DATABASE 데이터베이스명;
MariaDB [(none)]> CREATE DATABASE example;

# 데이터베이스 생성 확인
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| auth               |
| mysql              |
| performance_schema |
| test               |
+--------------------+

# 계정 생성
# https://mariadb.com/kb/en/library/create-user/
# CREATE USER '계정명'@'호스트' IDENTIFIED BY '비밀번호';
MariaDB [(none)]> CREATE USER 'testuser'@'%' IDENTIFIED BY 'testpwd123!@#';

# 권한 부여
# https://mariadb.com/kb/en/library/grant/
# GRANT 권한 PRIVILEGES ON 데이터베이스.테이블 TO '계정명'@'호스트';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON example.* TO 'testuser'@'%';

# 권한 확인
# https://mariadb.com/kb/en/library/show-grants/
# SHOW GRANTS FOR 계정명;
MariaDB [(none)]> SHOW GRANTS FOR testuser;




댓글
댓글쓰기 폼