[MySQL] Create Database-Create User-Grant on

By | Y2014Y2014-7M-ȭD

가장 기초이면서도 종종 쓰면서도 정리해두지 않으면 매번 찾아보아야 한다.
미리 정리해둔다.

–Create Database—
create database simple_board;

–Create User & Grant & Check Grant (for Remote Access)———–
CREATE USER board_u@localhost IDENTIFIED BY ‘12345’;

GRANT ALL PRIVILEGES ON simple_board.* TO board_u@localhost;

SHOW GRANTS FOR board_u@localhost;

–Modify Grant Privilege of User for remote access ————————————

UPDATE mysql.user SET host = ‘192.168.0.%’ WHERE host = ‘localhost’ AND user = ‘board_u’;

FLUSH PRIVILEGES;

—Revoke User Grant & Login Denial ————————-
REVOKE ALL PRIVILEGES ON simple_board.* FROM board_u@localhost;

REVOKE USAGE ON *.* FROM board_u@localhost;

—Delete User—————————————
DROP USER test@localhost;

— Create User: avoiding security options—————————————

cited from: http://linuxism.tistory.com/263

ERROR 1364 (HY000): Field ‘ssl_cipher’ doesn’t have a default value

Mysql 버전이 높아지면서 보안관련 인한 오류입니다.

User 생성시 Host, User ,Password, ssl_cipher, x509_issuer, x509_subject 를 입력 해 주셔야 합니다.

ssl_cipher, x509_issuer, x509_subject 값은 ” 빈값을 입력하세요.

ex)
 insert into user (Host, User, Password, ssl_cipher, x509_issuer, x509_subject )
values(‘localhost’,’사용자명’,password(‘비밀번호’),”,”,”);

ERROR 1364 (HY000): Field ‘authentication_string’ doesn’t have a default value

* mysql 5.5 에서 user 생성시 authentication_string 필드 추가. ” 값으로 넣어 주세요.

ex)
insert into user (Host, User, Password, ssl_cipher, x509_issuer, x509_subject, authentication_string

values(‘localhost’,’사용자명’, password(‘비밀번호’),”,”,”,”);

1,376 total views, 1 views today

댓글 남기기