Common
mysql 명령어 간단 정리
pajamacoder
2022. 12. 25. 22:02
장고를 이용한 웹 개발 중
mysql 관련 내용간단 요약
mysql version : 8.0
1. access remote mysql
mysql -h {remote_ip} -u {user_name} -p
로컬에서 docker 로 mysql server 를 운영하고 있다면 host 에서 아래 처럼 접속한다. 아래 -P 는 mysql 컨테이너에 forwarning 된 포트 이다.
mysql -h localhost -P 3306 -u mysql -p
2. 사용자 생성
create user {계정id}@‘%’ identified by ‘계정비밀번호’
3. 권한부여
grant all privileges on {DB이름}.* to {계정id}@‘%’ with grant option;
flush privileges;