/* 데이터베이스 확인 */
SHOW DATABASES;
/* 데이터베이스 생성 */
CREATE DATABASE head1ton_db;
/* 데이터베이스 접속 */
USE head1ton_db;
USE mysql;
/* USER 테이블 확인 */
DESC user;
/* 계정 생성 */
insert into user(host,user, password, ssl_cipher, x509_issuer,x509_subject,authentication_string)
values('localhost','head1ton',password('oracle'),'','','','');
/* 계정 확인 */
select host, user, password from user;
/* 권한 테이블 확인 */
select * from db;
desc db;
/* DB와 계정 연결 */
insert into db values ('localhost', 'head1ton_db', 'head1ton', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'y', 'n', 'n', 'y', 'y');
select * from mysql.db;
grant all on head1ton_db.* to 'head1ton'@'localhost' identified by 'oracle';
/* 외부 접근 권한 설정 */
grant all on head1ton_db.* to 'head1ton'@'localhost' identified by 'oracle';
GRANT ALL PRIVILEGES ON *.* to head1ton@localhost IDENTIFIED BY 'oracle' WITH GRANT OPTION;
/* 권한 적용 */
flush privileges;
/* 계정 삭제 */
drop user head1ton@localhost;
'연구개발 > MYSQL' 카테고리의 다른 글
MySQL 함수 - 날짜 관련 함수 (0) | 2013.01.11 |
---|---|
MySQL 함수 - 수학 함수 (0) | 2013.01.11 |
MySQL 함수 - 문자열 관련 함수들 (0) | 2013.01.11 |
기본적인 질의문(SELECT) (0) | 2013.01.11 |
테이블의 생성과 변경 (0) | 2013.01.11 |