2007년 3월 21일

MYsql에서 디비 생성과 삭제 방법

1. 디비 생성
--------------------------------------------------------------------------
[root@infoncom apache2]# mysql -u root -pEnter password:Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 1 to server version: 5.0.27-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database yoondb;Query OK, 1 row affected (0.03 sec)
--------------------------------------------------------------------------

2. 계정 생성
--------------------------------------------------------------------------
mysql> grant usage on *.* to yoondoin@localhost identified by "설정할 비번";Query OK, 0 rows affected (0.04 sec)
mysql> use yoondb;Database changedmysql> grant SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER on yoondb to yoondoin@localhost;Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)
--------------------------------------------------------------------------

3. 계정 삭제
--------------------------------------------------------------------------
mysql> use mysql;
Database changed
mysql> select * from user;

5 rows in set (0.00 sec)
mysql> delete from user where user='사용자이름';Query OK, 1 row affected (0.03 sec)___________________________________________________________________________

4. 데이터베이스 삭제
--------------------------------------------------------------------------
mysql> drop database 데이터베이스이름;
Query OK, 1 row affected (0.03 sec)___________________________________________________________________________

댓글 없음:

댓글 쓰기