ssouf
mysql 데이터베이스 및 계정생성 본문
1.데이터베이스 생성
mysql> create database 데이터베이스명;
2. 계정생성 및 권한주기
mysql> grant all privileges on 데이터베이스명.* to '계정명'@'IP주소' identified by '비밀번호';
- 특정 IP 주소허용
mysql> grant all privileges on 데이터베이스명.* to '계정명'@'192.168.0.0' identified by '비밀번호';
- localhost 허용
mysql> grant all privileges on 데이터베이스명.* to '계정명'@'localhost' identified by '비밀번호';
- 모든 IP 허용
mysql> grant all privileges on 데이터베이스명.* to '계정명'@'%' identified by '비밀번호';
- 패스워드는 변경없이 권한만 부여하는 경우
mysql> grant select, insert, update on test.* to user@localhost;
3. 메모리에 적용
mysql> flush privileges;
'SQL > MY-SQL' 카테고리의 다른 글
시놀로지 MariaDB 자동백업 후 FTP 전송 shell 파일작성 (0) | 2023.09.13 |
---|---|
mysql 초기 비밀 번호를 변경 (0) | 2020.06.28 |
mysql 외부에서 접속허용 (0) | 2010.07.14 |