프로젝트 서버를 시작하는데 에러가 발생했다.
에러 내용은 MySQL 서버에 연결이 거부되었다는 뜻이다.
이렇게 되면 mysql 서버 접속도 불가능할 것이다.
해결방법은 간단하다 : )
1️⃣ DB_HOST 수정
DB_CONNECTION=mysql
DB_HOST=127.0.0.1 //localhost를 127.0.0.1로 수정
DB_USERNAME=root
DB_PASSWORD=my_password
DB_DATABASE=db_name
DB_PORT=3306
DB_LOGGING=TRUE
이미 DB_HOST가 127.0.0.1로 설정되어 있다면 2️⃣번을 시도해보자
2️⃣ MySQL 서버 시작
먼저, MySQL 서버가 설치되어 있는지 확인한다.
$ which mysqld
/opt/homebrew/bin/mysqld
명령어를 입력했을 때 경로가 출력되면 MySQL 서버가 설치되어 있는 것이다.
MySQL 서버 시작
$ brew services start mysql
==> Successfully started `mysql` (label: homebrew.mxcl.mysql)
정상적으로 서버가 실행되었다~!
'💡 > 오류노트' 카테고리의 다른 글
[MySQL] Host 'xxx.xx.xx.xxx' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 에러 해결 (0) | 2024.12.19 |
---|---|
[Caddy] 3000포트가 열리지 않는 문제 해결(+PM2로 무중단 서비스 적용) (0) | 2024.08.26 |
[MySQL] [HY000][1130] "Host 'xxx.xxx.xx.x' is not allowed to connect to this MySQL server". 에러 해결 (0) | 2024.08.10 |
[Caddy] 웹 서버 설치 중 에러 해결 (0) | 2024.06.29 |
[AWS] 클라우드 서버 DB 연결 에러 해결 (0) | 2024.06.29 |