데이터베이스/MySQL
MySQL에서 데이터베이스 만들기와 유저 만들기
띠리
2007. 5. 14. 18:06
먼저 MySQL을 설치한다.
http://www.mysql.com/ MySQL은 옆사이트에서 다운로드를...
MySQL Command Line Client을 실행한다.
MySQL을 설치할때 입력한 root password를 입력한다.
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 37
Server version: 5.0.41-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
◆ 데이터베이스 만들기
mysql> create database memo;
Query OK, 1 row affected (0.06 sec)
Query OK, 1 row affected (0.06 sec)
◆ 데이터베이스 리스트 보기
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| memo |
| mysql |
| test |
+--------------------+
5 rows in set (0.02 sec)
+--------------------+
| Database |
+--------------------+
| information_schema |
| memo |
| mysql |
| test |
+--------------------+
5 rows in set (0.02 sec)
◆ 데이터베이스 선택하기
mysql> use memo;
Database changed
Database changed
◆ 유저 만들기
mysql> grant select, insert, delete, update, create, drop, file, alter, index
-> on *.* to muser identified by 'pass';
Query OK, 0 rows affected (0.08 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.13 sec)
flush privileges : 권한 데이터를 다시 읽는다.
유저의 권한이나 유저를 추가 삭제한 경우 flush privileges를 다시 해주는 것이 좋다.