AWS RDS 추가 계정 생성
grant 를 해줄 때 SELECT 만을 주면 안된다. EXECUTE 도 줘야 접속이 가능하다.
CREATE USER 'reader'@'222.111.99.55' IDENTIFIED BY 'mypassword'; DROP USER 'reader'@'222.111.99.55'; GRANT SELECT, EXECUTE ON *.* TO 'reader'@'222.111.99.55' WITH GRANT OPTION; -- 모든 권한 GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'all-round-user'@'%' WITH GRANT OPTION; -- 권한확인 SHOW GRANTS FOR 'bob'@'localhost'; SHOW GRANTS FOR CURRENT_USER; -- 특정 db 에 대한 모든 권한을 주는 법 GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, CREATE VIEW, EVENT, TRIGGER, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EXECUTE ON mydatabase.* TO 'siteuser'@'%'; FLUSH PRIVILEGES;
아래처럼 주소를 변경할 수 있다.
RENAME USER 'reader'@'222.111.99.55' TO 'reader'@'222.111.99.%';
댓글 없음:
댓글 쓰기