Database
[MySQL] DB 추가 및 사용자 추가
헤르메스의날개
2012. 1. 27. 11:34
728x90
-- DB 목록 보기
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.10 sec)
-- DB 생성
-- 사용자 생성
-- DB 생성
mysql> create database springdb;
Query OK, 1 row affected (0.06 sec) -- 사용자 생성
mysql> use mysql;
-- 사용자 계정생성
mysql> show tables;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| event |
| func |
| general_log |
| help_category |
| help_keyword |
| help_relation |
| help_topic
|
| host |
| ndb_binlog_index |
| plugin
|
| proc |
| procs_priv |
| proxies_priv |
| servers |
| slow_log |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
24 rows in set (0.30 sec)
-- 사용자 계정생성
mysql> create user '계정명'@'localhost' identified by '패스워드';
Query OK, 0 rows affected (0.18 sec)
-- 사용자 권한 추가
Query OK, 0 rows affected (0.18 sec)
-- 사용자 권한 추가
mysql> grant all privileges on *.* to '계정명'@'localhost';
Query OK, 0 rows affected (0.06 sec)
-- 변경된 내용을 메모리에 반영
Query OK, 0 rows affected (0.06 sec)
-- 변경된 내용을 메모리에 반영
mysql> flush privileges;
Query OK, 0 rows affected (0.07 sec)
Query OK, 0 rows affected (0.07 sec)
728x90