Database
local mysql root password 변경
codinglog
2021. 11. 9. 15:08
1. mysql 설치위치로 이동
/usr/local/mysql/bin
또는
/usr/local/opt/mysql/bin
2. sql 데몬 종료
>mysql.server stop
3. 안전모드로 패스워드 없이 root 로 로그인
>mysqld_safe --skip-grant-tables &
4. root로 mysql 로그인
>mysql -u root
5. database 선택
mysql>use mysql
6. 패스워드 변경
mysql>update user set authentication_string = PASSWORD('패스워드') where user = 'root'
7. 권한 적용
mysql>flush privileges;
8. 접속확인
mysql>exit;
mysql>mysql -u root -p
반응형