** mysql 접속하기 (맥북)
터미널 열고 → cd /usr/local/mysql/bin → ./mysql -u root -p
1. 사용자 추가
create user 'username'@'localhost' identified by 'password';
2. 사용자 권한 설정
grant all privileges on *.* to 'username'@'localhost';
flush privileges;
grant all privileges on db이름.table이름 to 'username'@'localhost';
flush privileges;
3. 사용자 삭제
drop user 'username'@'localhost';
'✏️ > Database' 카테고리의 다른 글
[MySQL] 프로시저 (0) | 2023.12.30 |
---|---|
[MySQL] Mac OS - error 2002 (hy000) can't connect to local mysql server through socket '/tmp/mysql.sock' (2) 해결 (0) | 2021.10.10 |