brew install mysql
reinstall이나 cleanup 해주기
brew reinstall mysql
brew cleanup mysql
mysql.server start
mysql.server stop
mysql -v
mysql_secure_installation
root 비밀번호 초기화 및 보안 강화 등
Would you like to setup VALIDATE PASSWORD component? => yes하면 암호의 강도를 확인한다길래 비밀번호 대충 지으려고 No
Remove anonymous users? => 익명의 사용자 Yes
Remove test database and access to it? => testDB만들어둔 것을 지울 것인가? No
Reload privilege tables now? => 지금 반영할 것인가? Yes
mysql -u root -p
접속이 잘 된 상태
root계정의 db들 확인
show databases;
use 데이터베이스명;
use mysql;
select user, host from user;
SELECT USER();
SELECT DATABASE();
exit;
sudo mysql -u root -p
최상위관리자 root user로 비밀번호 입력해서 접속
alter user 'root'@'localhost' identified by '비밀번호';
설정권한 부여
flush privileges;
password: sudo의 비번
Enter password: mysql의 비번