BBS > mysql

user add

작성자 : 이창우 (x1wins) | 등록일 : 2011-04-25 | 목록
첨부 파일이 없습니다.
첨부 이미지가 없습니다.
첨부 코드가 없습니다.
1. 윈도우용
http://dev.mysql.com/doc/refman/5.0/en/adding-users.html

INSERT INTO user (host, user, password, ssl_cipher, x509_issuer, x509_subject) VALUES ('localhost','x1wins',password('x1wins'),'','','');
INSERT INTO user (host, user, password, ssl_cipher, x509_issuer, x509_subject) VALUES ('%','x1wins',password('x1wins'),'','','');



INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv) VALUES('%', 'x1wins', 'x1wins', 'Y', 'Y', 'Y', 'Y','Y','Y');
INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv) VALUES('localhost', 'x1wins', 'x1wins', 'Y', 'Y', 'Y', 'Y','Y','Y');

GRANT ALL on x1wins.* TO x1wins;

FLUSH PRIVILEGES;



2. 리눅스용
USE mysql;

INSERT INTO user (host, user, password) VALUES ('localhost','아이디',password('패스워드'));

INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv)
VALUES('%', '데이터베이스', '아이디', 'Y', 'Y', 'Y', 'Y','Y','Y');

GRANT ALL on 데이터베이스.* TO 아이디;

FLUSH PRIVILEGES;
> reply 26 x1wins 2011-03-08 11:37:49.0
USE mysql;

INSERT INTO user (host, user, password) VALUES ('localhost','x1wins',password('1234'));
INSERT INTO user (host, user, password) VALUES ('%','x1wins',password('1234'));

INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv)
VALUES('%', '데이터베이스', '아이디', 'Y', 'Y', 'Y', 'Y','Y','Y');

GRANT ALL on 데이터베이스.* TO 아이디;

FLUSH PRIVILEGES;

> reply 27 x1wins 2011-04-05 13:55:03.0
INSERT INTO user (host, user, password) VALUES ('localhost','movie',password('1234')); 
INSERT INTO user (host, user, password) VALUES ('%','movie',password('1234'));

INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv) 
VALUES('%', 'movie', 'movie', 'Y', 'Y', 'Y', 'Y','Y','Y'); 

GRANT ALL on movie.* TO movie; 

FLUSH PRIVILEGES;










/*sample*/

USE mysql;

create database public;

INSERT INTO user (host, user, password) VALUES ('localhost','public',password('1234')); 
INSERT INTO user (host, user, password) VALUES ('%','public',password('1234'));

INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv)
VALUES('%', 'public', 'public', 'Y', 'Y', 'Y', 'Y','Y','Y'); 

GRANT ALL on public.* TO public; 

FLUSH PRIVILEGES;


/*sample2*/
USE mysql;

create database famz;

INSERT INTO user (host, user, password) VALUES ('localhost','famz',password('1234')); 
INSERT INTO user (host, user, password) VALUES ('%','famz',password('1234'));

INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv)
VALUES('%', 'famz', 'famz', 'Y', 'Y', 'Y', 'Y','Y','Y'); 
INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv)
VALUES('localhost', 'famz', 'famz', 'Y', 'Y', 'Y', 'Y','Y','Y');

GRANT ALL on *.* TO famz; 

FLUSH PRIVILEGES;


/*sample3*/
USE x1wins;

create database x1wins;

INSERT INTO user (host, user, password) VALUES ('localhost','x1wins',password('1234'));
INSERT INTO user (host, user, password) VALUES ('%','x1wins',password('1234'));

INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv)
VALUES('%', 'x1wins', 'x1wins', 'Y', 'Y', 'Y', 'Y','Y','Y');
GRANT ALL on x1wins.* TO x1wins;
FLUSH PRIVILEGES;
로그인 하셔야 댓글을 사용하실수 있습니다.
댓글쓰기를 누르면 로그인 페이지로 이동 후 돌아옵니다.
총 댓글 겟수 1
이창우(x1wins) | 2011-05-31
내용 없음
번호 제목 등록일 작성자 조회수
599 Error Code: 1175. (0) 2012-12-13 이창우 1482
512 mac mysql 설치 및 사용 (0) 2012-04-07 이창우 2293
373 sql formatter (0) 2011-11-07 이창우 1731
315 zeroboard migration (0) 2011-09-21 이창우 2600
229 한글깨짐문제 (0) 2011-07-18 이창우 2255
227 한글깨짐문제 (0) 2011-07-18 이창우 2261
211 select LAST_INSERT_ID() (0) 2011-07-10 이창우 1930
200 yum으로 mysql 설치 (0) 2011-07-07 이창우 1767
54 tag cloud (2) 2011-05-05 이창우 1785
24 Alter Table Syntax (0) 2011-05-01 이창우 1761
7 대소문자 구분 없애기 (0) 2011-04-25 이창우 2120
6 mysql datetime default (0) 2011-04-25 이창우 2618
-> user add (1) 2011-04-25 이창우 1907
< 1 >
글쓰기 검색