- Post in | WebDevelop/MySQL
- Post at | 2007. 8. 22. 23:52 | by 쥬리엘
DB사용자 등록 및 삭제
--------등록--------------------------------------------------------------------
[root@localhost /root]# mysql -p mysql (root비번설정하지 않았을땐 -p제외)
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is xxxx to server version: 3.23.32-log
Type 'help' for help.
//사용자를 등록. 접속권한만! 나머지는 N으로 합니다.
mysql> insert into user values ('localhost','user',password('passwd'),
'N','N','N','N','N','N','N','N','N','N','N','N','N','N');
Query OK, 1 row affected (0.00 sec)
// DB 권한을 줍니다.
mysql> insert into db values('localhost','DBname','user',
'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
version: 5.0.22
//사용자를 등록. 접속권한만! 나머지는 N으로 합니다.
mysql>insert into user values('localhost','user',password('passwd'),
'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N',
'N','N','N','N','N','N','N','N','N','N','N','N','N','N');
// DB 권한을 줍니다.
mysql> insert into db values('localhost','DBname','user',
'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
Query OK, 1 row affected (0.00 sec)
mysql> \q
Bye
// DB생성
[root@localhost /root]# /usr/local/mysql/bin/mysqladmin -p create DBname
Database "DBname" created.
// 서버재시작
[root@localhost /root]# /usr/local/mysql/bin/mysqladmin reload 또는
[root@localhost /root]# mysql.server stop
[root@localhost /root]# mysql.server start
--------------------------------------------------------------------------------
---------삭제-------------------------------------------------------------------
mysqladmin -p drop DBname
[root@localhost /bin] ./mysql -p mysql
password : xxxxx
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is xxxx to server version: 3.23.32-log
Type 'help' for help.
mysql> delete from user where user='user';
mysql> delete from db where user='user';
mysql> \q
'WebDevelop > MySQL' 카테고리의 다른 글
mysql함수 [숫자열, 문자열, 집계, 날짜, 기타함수...] (0) | 2007.09.03 |
---|---|
select 시 rownum(자동으로 줄 번호 붙이기) (0) | 2007.08.22 |
MySQL 루트비번 분실시 대처요령 (0) | 2007.08.22 |