[MySQL Error] The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

2021. 3. 19. 22:45·Error code 모음/1. SQL errors
반응형

Load Data 시도중 , 아래의 에러를 만났다..

The MySQL server is running with the --secure-file-priv option 
so it cannot execute this statement

예전에도 이와 비슷한 것을 시도한 적이 있어 기억이 났었다.

 

 

 

1. 에러 원인


에러의 원인은 mysql 의 경우에는 보안을 위해 특정 경로에서만 파일을 업로드할 수 있도록 설정되어 있다. 그 이외의 경로에서 load infile 을 할 경우 에러가 발생한다. 

 

 

 

 

 

2. 해결 방법


1) MySQL 에 접속한 후 경로 확인

SELECT @@GLOBAL.secure_file_priv;

+---------------------------+
| @@GLOBAL.secure_file_priv |
+---------------------------+
| /var/lib/mysql-files/     |
+---------------------------+

 

보안을 위해서 secure_file_priv에 특정 경로가 설정되어 있다.

경로가 설정되어 있다면 해당 경로에 있는 파일만 import 할 수 있다.

간단한 방법으로는 해당 경로로 파일을 옮겨 LOAD INFILE 을 해주면, 파일이 업로드된다.

 

하지만, 어디서든지 파일을 넣고 싶다면 설정된 경로를 지우면 된다.

워크벤치의 경우에는 테이블을 더블클릭하고 지우고 APPLY 를 누르면 지워진다

 

 

3. 참고 링크


snepbnt.tistory.com/89?category=781964

 

[Mysql 에러] ERROR 3948 (42000): Loading local data is disabled; this must be enabled on both the client and server sides 에

이것만큼 골치아픈 것도 없을 것이다....후 1시간에 걸쳐서 사투한 끝에 겨우 풀었는데.. 위에서 하라는대로 다 했엇다.. 이 에러가 왜 나는 것인지는 아직 제대로 이해하지는 못했지만..풀어내서

snepbnt.tistory.com

 

반응형
저작자표시 비영리 변경금지 (새창열림)

'Error code 모음 > 1. SQL errors' 카테고리의 다른 글

[Sql Error] Ignoring query to other database  (0) 2021.04.30
[MySql Error] ERROR 1819 (HY000): Your password does not satisfy the current policy requirements  (0) 2021.04.29
[MySQL Error] No database select the default db to be used by double-clicking its name in the schemas list in the sidebar 에러  (0) 2021.02.02
[Oracle Error] 오라클 비밀번호 만료 에러 ORA-28001: the password has expired  (0) 2020.12.01
[PostgreSQL Error] duplicate key value violates unique constraint  (0) 2020.10.30
'Error code 모음/1. SQL errors' 카테고리의 다른 글
  • [Sql Error] Ignoring query to other database
  • [MySql Error] ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
  • [MySQL Error] No database select the default db to be used by double-clicking its name in the schemas list in the sidebar 에러
  • [Oracle Error] 오라클 비밀번호 만료 에러 ORA-28001: the password has expired
쟈누
쟈누
Ad astra per aspera
    반응형
  • 쟈누
    쟈누의 기록공간
    쟈누
  • 전체
    오늘
    어제
    • 분류 전체보기 (444)
      • AWS (31)
        • Glue (4)
        • S3 (1)
      • 클라우드 (0)
      • Data Engineering (37)
        • GitHub (10)
        • NiFi (11)
        • Spark (10)
        • Snowflake (0)
        • 머신러닝, AI (6)
      • 언어 (118)
        • 데이터 베이스 (42)
        • JAVA (9)
        • Python (34)
        • Java Script (15)
        • Linux (18)
      • 프로젝트, 인강 그리고 책 (30)
        • Spotify Project (7)
        • RASA chatbot Project (9)
        • Naver shopping Project (6)
        • 빅데이터를 지탱하는 기술 (8)
      • OLD (56)
        • IT 용어 사전 (13)
        • Front End (12)
        • Back End (31)
      • Error code 모음 (165)
        • 1. SQL errors (17)
        • 2. Hadoop errors (20)
        • 3. Linux Errors (14)
        • 4. Python errors (33)
        • 5. JAVA, Spring errors (41)
        • 6. Jav Script errors (10)
        • 7. Dev Tools errors (9)
        • 8. Git errors (8)
        • 9. Jenkins Errors (4)
        • 10. airflow Errors (2)
        • 11. Aws errors (7)
      • 개인 (1)
        • 책 (1)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
    • 블로그 관리
    • 글쓰기
  • 링크

  • 공지사항

    • 간단한 블로그 소개
  • 인기 글

  • 태그

    error
    파이썬
    SQL
    에러
    json
    Spring
    python error
    MySQL
    java
    NiFi
    Git
    AWS
    install
    node
    API
    설치
    Python
    linux
    리눅스
    자바
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
쟈누
[MySQL Error] The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
상단으로

티스토리툴바