GrepBoard/매뉴얼
605 편 ·

MySQL 1524 mysql_native_password 8.4

·시험 환경 MySQL 8.4.13 (Docker mysql:8.4) · 2026-10·시험 범위 ↓·6 단계

MySQL 8.4 의 ERROR 1524 는 mysql_native_password 가 기본으로 꺼진 탓입니다. 계정을 caching_sha2_password 로 옮기거나 플러그인을 잠시 다시 켭니다.

output
ERROR 1524 (HY000): Plugin 'mysql_native_password' is not loaded

MySQL 8.4.0 부터 mysql_native_password 플러그인이 기본으로 꺼져서, 이 플러그인으로 인증하던 계정은 비밀번호가 맞아도 로그인하지 못합니다. 계정을 caching_sha2_password 로 바꾸는 것이 해법이고, 앱을 당장 고칠 수 없으면 mysql_native_password=ON 으로 잠시 다시 켭니다. 이 플러그인은 9.0.0 에서 아예 빠졌으므로 켜는 쪽은 8.4 안에서만 통합니다.

공식 문서의 일정은 이렇습니다(Native Pluggable Authentication).

판mysql_native_password
8.0.34폐기 예정(deprecated)
8.4서버에 들어 있지만 기본 꺼짐
9.0.0제거

[1] 8.0 에서 8.4 로 올린 뒤 일부 계정만 막혔는지 봅니다. 같은 데이터로 올린 서버에서 옛 계정은 1524, 새 계정은 그대로 들어갑니다. 소켓으로 붙어도 결과가 같습니다.

console
$ mysql -ulegacy -p'<비밀번호>' -h127.0.0.1 -e 'SELECT 1'mysql: [Warning] Using a password on the command line interface can be insecure.ERROR 1524 (HY000): Plugin 'mysql_native_password' is not loaded$ mysql -umodern -p'<비밀번호>' -h127.0.0.1 -e 'SELECT CURRENT_USER()'mysql: [Warning] Using a password on the command line interface can be insecure.CURRENT_USER()modern@%

[2] 플러그인 상태와 걸리는 계정을 확인합니다. DISABLED 이면 이 글의 경우이고, 두 번째 결과가 옮겨야 할 계정 목록입니다.

console
$ mysql -uroot -p'<비밀번호>' -e "SELECT PLUGIN_NAME, PLUGIN_STATUS FROM information_schema.PLUGINS WHERE PLUGIN_NAME IN ('mysql_native_password','caching_sha2_password')"mysql: [Warning] Using a password on the command line interface can be insecure.PLUGIN_NAME	PLUGIN_STATUScaching_sha2_password	ACTIVEmysql_native_password	DISABLED$ mysql -uroot -p'<비밀번호>' -e "SELECT user, host, plugin FROM mysql.user WHERE plugin = 'mysql_native_password'"mysql: [Warning] Using a password on the command line interface can be insecure.user	host	pluginlegacy	%	mysql_native_password

목록에 root 가 있으면 root 도 막혀 있습니다. 그때는 다른 관리자 계정으로 들어가거나 [5] 처럼 잠시 켜고 들어가 옮깁니다.

[3] 계정을 caching_sha2_password 로 옮깁니다. ALTER USER … IDENTIFIED WITH 에 비밀번호를 다시 넣어야 합니다. 앱 설정에 있는 그 비밀번호를 그대로 쓰면 앱 쪽은 고칠 것이 없습니다.

console
$ mysql -uroot -p'<비밀번호>' -e "ALTER USER 'legacy'@'%' IDENTIFIED WITH caching_sha2_password BY '<비밀번호>'; SELECT user, host, plugin FROM mysql.user WHERE user='legacy'"mysql: [Warning] Using a password on the command line interface can be insecure.user	host	pluginlegacy	%	caching_sha2_password

[4] 옮긴 뒤 암호화하지 않은 TCP 로 붙는 앱은 한 번 더 막힐 수 있습니다. caching_sha2_password 는 TLS·소켓 같은 보안 연결이나 RSA 키 교환을 요구합니다(Caching SHA-2 Pluggable Authentication).

console
$ mysql -ulegacy -p'<비밀번호>' -h127.0.0.1 --ssl-mode=DISABLED -e 'SELECT 1'mysql: [Warning] Using a password on the command line interface can be insecure.ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.$ mysql -ulegacy -p'<비밀번호>' -h127.0.0.1 -e "SELECT CURRENT_USER(); SHOW SESSION STATUS LIKE 'Ssl_version'"mysql: [Warning] Using a password on the command line interface can be insecure.CURRENT_USER()legacy@%Variable_name	ValueSsl_version	TLSv1.3

TLS 를 쓰면 들어갑니다. TLS 를 끈 채 써야 하면 클라이언트가 서버 공개 키를 받게 합니다(mysql 의 --get-server-public-key, 커넥터마다 같은 뜻의 옵션). 문서대로 한 번 성공하면 서버 메모리 캐시에 남아 다음부터는 보안 연결 없이도 통과하지만, 서버 재시작·비밀번호 변경·FLUSH PRIVILEGES 뒤에는 캐시가 비어 다시 이 오류가 납니다. 「어제는 됐는데 재시작하니 안 된다」면 이 경우입니다.

console
$ mysql -ulegacy -p'<비밀번호>' -h127.0.0.1 --ssl-mode=DISABLED --get-server-public-key -e 'SELECT CURRENT_USER()'mysql: [Warning] Using a password on the command line interface can be insecure.CURRENT_USER()legacy@%

[5] 앱을 바로 고칠 수 없으면 플러그인을 잠시 켭니다. [mysqld] 절에 한 줄을 넣고 재시작합니다(시험은 같은 뜻의 시작 옵션 --mysql-native-password=ON).

my.cnf ([mysqld] 절)
[mysqld]mysql_native_password=ON
console
$ mysql -uroot -p'<비밀번호>' -e "SELECT PLUGIN_NAME, PLUGIN_STATUS FROM information_schema.PLUGINS WHERE PLUGIN_NAME='mysql_native_password'"mysql: [Warning] Using a password on the command line interface can be insecure.PLUGIN_NAME	PLUGIN_STATUSmysql_native_password	ACTIVE

켜 둔 서버에서 이 플러그인이 쓰이면 서버 로그에 아래 폐기 예정 경고가 남습니다(시험에서는 계정을 만들고 로그인한 뒤 한 줄). 9.x 로 올리기 전에 [2] 의 목록이 비어 있어야 합니다.

output
2026-10-27T08:09:39.136083Z 9 [Warning] [MY-013360] [Server] Plugin mysql_native_password reported: ''mysql_native_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'

[6] 8.0 설정 파일에 default_authentication_plugin 이 남아 있으면 8.4 는 시작조차 하지 않습니다. 8.4.0 에서 이 변수가 없어지고 authentication_policy 로 바뀌었기 때문입니다(What Is New in MySQL 8.4).

output
2026-10-27T08:10:10.638707Z 0 [ERROR] [MY-000067] [Server] unknown variable 'default-authentication-plugin=mysql_native_password'.…2026-10-27T08:10:10.639375Z 0 [ERROR] [MY-010119] [Server] Aborting

그 줄을 지우고 시작합니다. 새 계정의 기본 플러그인은 authentication_policy 의 첫 칸이 정하며, 8.4 기본값 *,, 에서는 caching_sha2_password 입니다. 새 계정을 일부러 mysql_native_password 로 만들지 않습니다 — 꺼진 상태에서는 CREATE USER … IDENTIFIED WITH mysql_native_password 도 1524 입니다.

옮긴 뒤에도 1045 가 나면 비밀번호나 호스트 부분 문제입니다. MySQL 1045 Access denied (password: YES)를 봅니다.

MySQL slow log 로그를 브라우저에서 바로 분석 ↗ — 아무것도 올라가지 않습니다.

#mysql#mysql-8.4#mysql_native_password#caching_sha2_password#error-1524