본문 바로가기
Database/MYSQL

Mysql 5.7 유저 생성시 달라진점(CREATE USER)

by 반화넬 2018. 5. 16.
반응형


Mysql 5.7 유저 생성시 달라진점(CREATE USER)


# 5.7 이전 버젼
GRANT SELECT, INSERT, UPDATE, DELETE,CREATE,EXECUTE on DB_NAME.* TO 'USER'@'HOST' IDENTIFIED BY 'PASSWORD';
FLUSH PRIVILEGES;


# 5.7에서 실행시 경고
"MySQL is started in --skip-name-resolve mode; you must restart it without this switch for this grant to work"
"Using GRANT statement to modify existing user's properties other than privileges is deprecated and will be removed in future release. Use ALTER USER statement for this operation."


# 5.7 부터
CREATE USER 'USER'@'localhost' IDENTIFIED BY 'PASSWORD' PASSWORD EXPIRE NEVER;
GRANT ALL PRIVILEGES on DB_NAME.* TO 'USER'@'HOST';
FLUSH PRIVILEGES;

반응형