🔐Security

🕵️‍♂️ 웹 해킹 - MySQL 초기 패스워드 변경

비엔 Vien 2025. 6. 11. 10:29
MySQL 설치하깅

➜  ~ git:(main) ✗ brew install mysql
➜  ~ git:(main) ✗ brew services start mysql
==> Successfully started `mysql` (label: homebrew.mxcl.mysql)

// 홈브루로 mysql 설치시 보통 비번 없어서 처음에 mysql -u root -p 할때 다른 비번 입력하면 오류남
➜  ~ git:(main) ✗ mysql -u root 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 9.3.0 Homebrew

Copyright (c) 2000, 2025, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

 

 


 

 

 

뭐여 옛날 강의라 ㅡㅡ 챗지피티 없엇으면 이걸 어케 알어요 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ

 

암튼! 굿

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'crehacktive';
Query OK, 0 rows affected (0.044 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected, 1 warning (0.012 sec)

mysql> exit
Bye

 

이제 mysql -u root -p입력하구 위 패스워드 입력하면 된다!!!