반응형

Languages 32

[ERROR] org.springframework.security.authentication.InternalAuthenticationServiceException

org.springframework.security.authentication.InternalAuthenticationServiceException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: The server time zone value '���ѹα� ǥ�ؽ�' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specific time zone value ..

Languages/SQL 2022.05.23

[Error] H2 데이터베이스 최신 버전

H2 데이터베이스를 다시 설치하면서 이전에 잘 동작했던 테스트 코드가 실행되지 않았다. 💕 해결 2.1.210, 2.0.206 두 버전 다 최신 버전이라서 잘 안됨. 1.4.200 버전을 쓰니까 잘 된다. 최신 버전 사용하면 이전에 잘 되던 코드도 안 되는 경우가 많다는 것을 느꼈다😂 첫 번째 문제) user가 identifier라면서 테이블명이 user로 안 만들어진다. 엔티티에 @Table(name="users")도 붙여봤지만, 다른 에러가 뜬다. 두 번째 문제) id가 null insert into post (id, created_date, modified_date, author, content, title, view) values (null, ?, ?, ?, ?, ?, ?) @GeneratedVa..

Languages/SQL 2022.03.31

[Error] Public Key Retrieval is not allowed

java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed application.properties에서 useSSL=true로 해줌 그 전에는 false였음 MySQL 8.0 이상부터 SSL로 연결해야 한다. SSL은Secure Sockets Layer이다. 데이터를 암호화해서 보안을 유지 spring.datasource.url=jdbc:mysql://localhost:3306/board?useSSL=true 참고 👇 https://deeplify.dev/database/troubleshoot/public-key-retrieval-is-not-allowed [Mysql] Public key retrieval is not..

Languages/SQL 2022.03.29

[Error] Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column

delete from 테이블명; Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect. 삭제 쿼리를 실행하니 다음과 같은 에러가 뜸 ✨ 해결 where 없이 다 삭제할 때 1. Safe Updates (rejects UPDATEs and DELETEs with no restrictions) 체크 해제 2. workbench 다시 시작 3. 삭제 쿼리 다시 실행하면 잘 된다. 참고 👇 https://l..

Languages/SQL 2022.03.19

time

import time start=time.time()# 시작 print(time.time() - start)# 끝-시작시간=실행시간 참고 👇 https://opentutorials.org/module/2980/17436 코드 실행시간 측정 - 파이썬_실전 프로젝트 문제를 풀다 보면, 실행 시간이 오래 걸리는 문제들이 간혹 있었습니다. 코드의 실행속도를 높일려면, 일단 시간을 측정해보는게 좋습니다. 시간 측정 코드 import time start = time.time() # 시작 시간 opentutorials.org

Languages/Python 2021.12.30

*(packing / unpacking)

1. packing은 *매개변수 matrix=[[*map(int, input().split())] for _ in range(N)] 위치인자를 여러 개 받을 수 있다. ❗아래와 같이 list()에 packing을 넣으면 에러 뜬다. matrix=[list(*map(int, input().split())) for _ in range(N)] 2. 위치인자를 unpacking할 때 *인자 사용 lst=[1, 2, 3] print(*lst) # 1 2 3 print(lst)일 경우 [1, 2, 3]이다. 참고 👇 https://wikidocs.net/22801 3) packing, unpacking `print`함수는 출력하고자하는 객체가 몇개던지, 즉 몇개의 인자를 받던지 상관하지 않고 출력해줍니다. ``` ..

Languages/Python 2021.09.16

순열과 조합

1. 순열 itertools.permutations(iterable, r=None) iterable에서 r 길이 만큼 순열을 생성해 반환 r이 주어지지 않으면, 기본값은 iterable의 길이다. 순열 튜플은 iterable의 순서에 기반해서 만들어진다. 즉, 값이 아닌 위치를 기준으로 순열이 생성된다. 2. 조합 itertools.combinations(iterable, r) iterable에서 r 길이 만큼 조합을 생성 조합 튜플은 iterable의 순서에 기반해서 만들어진다. 즉, 값이 아닌 위치를 기준으로 조합이 생성된다. from itertools import product lst=[[1, 2], [4, 5], [7, 8]] print(list(product(*lst))) 데카르트 곱 위의 co..

Languages/Python 2021.08.17

[Error] Invalid use of NULL value

Invalid use of NULL value column을 not null로 제약 조건을 변경하려고 했더니 생긴 에러 이 문제의 원인은 해당 column이 현재 null 값을 가지고 있기 때문이다. update문으로 null값에 임의의 값을 넣어준다. update 테이블명 set 컬럼명=값 where 컬럼명 is null; 그 후 not null로 변경하면 성공 alter table 테이블명 modify column 컬럼명 타입 not null; 참고 https://stackoverflow.com/questions/22971586/mysql-alter-table-causes-error-invalid-use-of-null-value/22971654 MySQL Alter table causes Error:..

Languages/SQL 2021.08.06

reduce(function, iterable[, initializer])

reduce(function, iterable[, initializer])는 2개씩 iterable의 값을 function에 적용한다. 중첩해서 function을 적용해나간다. reduce(lambda x, y : x+y, [1, 2, 3, 4, 5]) 계산 결과는 ((((1+2)+3)+4)+5)이다. x가 중첩된 값, y는 갱신되는 값이다. 선택 파라미터인 initializer는 iterable이 비었을 때 기본값이다. initializer는 iterable이 있을 때는 iterable보다 먼저 앞에 위치해 계산됨. answer=reduce(lambda x, y : x*(y+1), cnt.values(), 1)-1 initializer가 1이니까 x가 1이 대입된다. 참고 👉 파이썬 documentat..

Languages/Python 2021.06.23
반응형