"Access denied for user ''@'localhost' (using password: YES)",
by 이쟝2022. 12. 17.
문제 상황
code: 'ER_ACCESS_DENIED_ERROR',
errno: 1045,
sqlState: '28000',
sqlMessage: "Access denied for user ''@'localhost' (using password: YES)",
sql: undefined
},
original: Error: Access denied for user ''@'localhost' (using password: YES)
로컬에서는 연동 되는데, 다른 서버에서 DB 연동을 하려고 했는데 계속 해서 오류
1. 권한 주기 설정함
유저랑 비번 DB와 동일하게!
CREATE USER 'user'@'%' IDENTIFIED BY '비밀번호';
GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES; SELECT host, user, plugin, authentication_string FROM mysql.user;
비밀번호 바꿀 경우
ALTER USER 'user'@'%' IDENTIFIED WITH caching_sha2_password BY 'DB비밀번호';
그래도 오류남 :(
2. 알고보니 config.js 파일에서 env파일로 설정해놓고, env 파일을 수정안했어서 오류남..