1. 사용자 생성
GRANT USAGE ON *.* TO 사용자ID@접속호스트 IDENTIFIED BY "패스워드"
or
GRANT USAGE ON *.* TO zboard@localhost IDENTIFIED BY "password"
or
2. 권한 부여
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON
디비이름 TO 사용자ID@접속호스트
디비이름 TO 사용자ID@접속호스트
or
or
3. 권한 로드
FLUSH PRIVILEGES
===============================================================================
C:\>cd APM_Setup\Server\MySQL\bin
C:\APM_Setup\Server\MySQL\bin>mysql.exe -uroot -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 4.0.15-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> CREATE DATABASE IF NOT EXISTS zboard;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT USAGE ON *.* TO zboard@localhost IDENTIFIED BY "password";
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON zboard.*
TO zboard@localhost;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
C:\APM_Setup\Server\MySQL\bin>mysql.exe -uzboard -p zboard
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17 to server version: 4.0.15-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> exit
Bye
C:\APM_Setup\Server\MySQL\bin>
C:\APM_Setup\Server\MySQL\bin>mysql.exe -uroot -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 4.0.15-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> CREATE DATABASE IF NOT EXISTS zboard;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT USAGE ON *.* TO zboard@localhost IDENTIFIED BY "password";
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON zboard.*
TO zboard@localhost;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
C:\APM_Setup\Server\MySQL\bin>mysql.exe -uzboard -p zboard
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17 to server version: 4.0.15-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> exit
Bye
C:\APM_Setup\Server\MySQL\bin>
'Databases' 카테고리의 다른 글
MsSql 날짜 함수 (0) | 2010.04.14 |
---|---|
MS SQL Server 에서 날짜 및 시각 비교하는 SQL (0) | 2010.04.14 |
ldf 삭제 mdf 으로만 복원 (0) | 2010.03.22 |
MSSQL [@@IDENTITY, SCOPE_IDENTITY, IDENT_CURRENT] 차이점 바로 알기 (0) | 2010.03.17 |
무료 Mysql 관리자 프로그램 HeidiSQL (0) | 2010.03.17 |