반응형
출처 : http://lab4109.blogspot.com/2013/10/mariadb-database-user.html
MySQL과 똑같다. 설명이 필요 없음...
일단 DB 생성
1
2 |
MariaDB [(none)]> create database dottegidb; Query OK, 1 row affected (0.00 sec) |
그리고 사용자 생성
1
2 |
MariaDB [dottegidb]> create user 'xxxxxx' @ 'localhost' identified by 'yyyyyy' ; Query OK, 0 rows affected (0.00 sec) |
혹시라도 외부에서 접속을 할 수 있게 하려면 localhost가 아닌 '%'로 하나 더 생성해 줘야 함.
마지막으로 권한 부여
마지막으로 권한 부여
1
2
3
4
5 |
MariaDB [dottegidb]> grant all privileges on dottegidb.* to yangsae@localhost; Query OK, 0 rows affected (0.00 sec) MariaDB [dottegidb]> flush privileges; Query OK, 0 rows affected (0.00 sec) |
잘 됐는지 테스트
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 |
~> mysql -uxxxxxx -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 2 Server version: 5.5.32-MariaDB Source distribution Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | dottegidb | | test | +--------------------+ 3 rows in set (0.00 sec) |
나는 db client로 sequel pro를 사용하는데 connector는 그냥 mysql에서 제공하는 것으로 사용한다. 그리고 기존에 mysqldb에 만들어 뒀던 db와 같은 이름의 db를 여기에 생성했더니 지난 설정 그대로 접속이 바로 됨.
반응형