전체 글 36

[mysql] macOS에서의 MySQL 인증 플러그인 문제

1. 에러내용debeaver에서 localhost에 접속이 안되면서 access denied 떨어짐. terminal 에서 mysql -u root -p 접속 시, 아래와 같은 에러 떨어짐. ERROR 2059 (HY000): Authentication plugin 'mysql_native_password' cannot be loaded: dlopen(/opt/homebrew/Cellar/mysql/9.0.1_7/lib/plugin/mysql_native_password.so, 0x0002): tried: '/opt/homebrew/Cellar/mysql/9.0.1_7/lib/plugin/mysql_native_password.so' (no such file), '/System/Volumes/Preboo..

카테고리 없음 2024.12.19

[Linux] tail, cat, grep 으로 로그 확인하기

로그 확인 시, 유용  1.  tail : 파일 마지막 부분 출력(기본값 : 마지막 10줄)-f : 파일의 실시간 업데이트 계속 추적(로그 모니터링에 유용)-n : 마지막 N줄을 출력tail -f log.txt 또는 tail -n 100 log.txt 2. cat :  파일 내용 전체 출력- 여러 파일 연결해서 출력 가능-n : 줄 번호 표시-b : 비어있지 않은 줄에만 번호 표시cat file.txt 또는 cat file1.txt file2.txt  3. grep : 파일에서 특정 패턴을 검색해서 매칭되는 줄 출력-i : 대소문자 구분없이 검색-l : 매치된 파일의 이름만 출력# 로그 파일에서 실시간으로 에러 메시지 모니터링tail -f log.txt | grep "error"# 여러 파일의 내용을 합..

카테고리 없음 2024.12.19

[Error] Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS.

1. 문제상황Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS. Check whether you have a dependency on 'io.netty:netty-resolver-dns-native-macos'. Use DEBUG level to see the full stack: java.lang.UnsatisfiedLinkError: failed to load the required native library   2. 원인- Apple 의 M1, M2, M3 칩은..

카테고리 없음 2024.12.06

[Spring] 컴포넌트 스캔

흔히 알고있는 controller, service, 등등..새로운 패키지를 만들 때, 어디에 만들어야할까? 하는 생각에서 출발한다. 어디에 만들어야하는지 찾아보면, @SpringBootApplication 이 붙어있는 패키지에 만들어야한다. 왜일까? 그건 컴포넌트 스캔에 의해, 저 어노테이션이 붙은 패키지와 그 하위 패키지를 스캔해서 스프링빈으로 등록하기 때문이다.따라서, 메인 애플리케이션 클래스와 동일한 패키지 또는 그 하위 패키지에 컨트롤러, 서비스, 엔티티 클래스를 위치시켜서자동으로 스캔되고 등록되도록 위치에 맞게 작성해야한다. 그럼, 스프링빈은 뭘까?스프링 Ioc가 관리하는 객체이다. Ioc 먼저 차근차근 살펴보자.기존 사용자가 모든 작업을 제어했다면, 그 작업을 특별한 객체에 위임해서객체의 생성..

Spring 2024.07.13

[Error] failed to configure a datasource: 'url' attribute is not specified and no embedded datasource could be configured.

1. 원인DB 연결에 필요한 정보가 없어서 발생.  2. 해결나는 mysql 을 사용할것이기 때문에, application.properties에 --------------------------------------------------------------------spring.application.name=board_selfspring.datasource.url=jdbc:[database명]://localhost:3306/[shema명]spring.datasource.username=rootspring.datasource.password=spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver---------------------------------..

Error 2024.07.13

쿠키(Cookie)와 세션(Session) 개념.

1 ) 쿠키와 세션은 왜 이용할까?http 프로토콜의 약점 보완하기 위해 사용.http의 프로토콜의 약점? 비연결지향적이고, 상태정보 유지를 하지 않는다는 특징이 있음. Connectionless 비연결지향클라이언트에서 서버에 요청을 보내면 서버는 클라이언트에 응답을 하고 연결을 끊음.Stateless (상태정보 유지 안함)연결을 끊는 순간, 클라이언트와 서버의 통신이 끝나면서 상태 정보를 유지하지않는 특징이 있음.ex. 매번 페이지를 이동할 때마다 로그인을 다시 하거나, 상품 선택 후 구매 페이지에 상품 정보가 없거나 등  2 ) 쿠키http 에서 클라이언트의 상태 정보를 쿠키 형태로 클라이언트 pc 에 저장했다가 필요시에 참조하거나 재사용 가능.key-value 쌍의 데이터 파일쿠키 이름, 쿠키 값,..

카테고리 없음 2024.06.29

[node] node 시작하기

1. 프로젝트 생성할 폴더 만들기.mkdir my-node-projectcd my-node-project  2. 프로젝트 폴더 안에서 프로젝트 초기화.(-y 옵션 :  package.json 자동 생성.)npm init -y  3. vscode 안에서 필요한 패키지 설치. (나는 express 설치!)npm install express  4. 기본 파일 생성touch index.js  5. 코드 작성const express = require('express');const app = express();const port = 3000;app.get('/', (req, res) => { res.send('Hello World!');});app.listen(port, () => { console.log(`E..

카테고리 없음 2024.06.25

refresh token / access token

JWT token 이란?- 유저의 신원이나 권한을 결정하는 정보를 담고있는 데이터 조각- 비밀키를 이용한 서명된 JSON 형태 데이터 -> 클라이언트-서버가 안전하게 통신할 수 있음.- 탈취를 방지하기 위해 유효기간을 두어야함.    1. Access token- 유효기간 짧음.(60일) 2. Refresh token - 유효기간 길다.(1년)- access token 만료 시 사용.     3. 통신 방법 설명1. 로그인에 성공한 클라이언트는 서버로부터 refresh , access token 둘 다 받음.2. 클라이언트는 refresh , access 로컬에 저장해놓음.3. 클라이언트는 헤더에 access token 을 넣고 api 통신함.4. 일정 기간이 지나 access token 만료가 되면, ..

카테고리 없음 2024.05.16