⚙️백엔드/MySQL
MySQL - 계정 생성 / DB 생성 권한 부여
Janger
2022. 9. 14. 14:12
728x90
계정 생성
create user '계정아이디'@localhost identified by '비밀번호'; <-내부에서만 접속
create user '계정아이디'@'%' identified by '비밀번호'; <- 외부에서도 접속
DB 생성 권한 부여
grant all privileges on *.* to '계정아이디'@localhost identified by '비밀번호';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 에러가 발생한 경우
grant all privileges on *.* to '계정아이디'@localhost;
identified by 부분 지우고 다시 입력
계정 목록 확인
SELECT Host,User,plugin,authentication_string FROM mysql.user;
출처:
PC에 mysql 설치하고 유저(user)생성하기
mysql 유저생성하기 명령어 : create user 유저명@localhost identified by '비밀번호'; 위 명령어를 mysql을 활성화시킨후에 작성하면 된다. 유저명에는 원하는 유저명을 작성해주고 뒷부분에 '' 작은따옴표
k-channel.tistory.com
728x90