MySQL(MariaDB) DATABASE, 사용자 생성 및 권한 추가 > 개발자팁

개발자팁

개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.

MySQL(MariaDB) DATABASE, 사용자 생성 및 권한 추가 정보

MySQL MySQL(MariaDB) DATABASE, 사용자 생성 및 권한 추가

본문

mysql root 접속

 

[root@localhost ~]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]> 

 

 

DATABASE 생성

 

MariaDB [(none)]> create database dbname character set utf8mb4 collate utf8mb4_unicode_ci;
Query OK, 1 row affected (0.01 sec)

 

 

USER 생성

 

MariaDB [(none)]> create user 'dbuser'@'localhost' identified by 'dbuserpassword';
Query OK, 0 rows affected (0.00 sec)

 

 

권한부여

 

MariaDB [(none)]> grant all privileges on dbname.* to 'dbuser'@'localhost';
Query OK, 0 rows affected (0.00 sec)

 

 

마무리

 

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

추천
14

댓글 5개

전체 5,352
개발자팁 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT