개인공부

개인공부/오류 및 에러

[Windows] MySQL8.0 root 패스워드 분실

테스트 환경 Windows 10 MySQL Wrok bench 사용 cmd 1창 - 관리자 권한 실행 net stop mysql80 cd C:\Program Files\MySQL\MySQL Server 8.0\bin mysqld --datadir="C:\ProgramData\MySQL\MySQL Server 8.0\data" --console --skip-grant-tables --shared-memory cmd 2창 - 관리자 권한 실행 mysql -u root use mysql; select host, user, plugin, authentication_string, password_last_changed from user; update user set authentication_string=null..

개인공부/Linux

[Linux] cp 명령어 사용 시 파일 명에 날짜 넣기

단순 명령어만 입력할 때 cp [경로]/[파일명].[확장자] [경로].[파일명]$(date '+%Y$m$d').[확장자] # ex cp /home/test.html /home/backup/test$(date '+%Y$m$d').txt # 해당 명령어 입력 후 확인하면 아래와 같은 파일이 확인되어야 한다. # cd /home/backup/ 경로 내에서 파일 생성 확인 test20220609.txt crontab에서 입력할 때 # 수정 명령어는 crontab -e * * * * * cp [경로]/[파일명].[확장자] [경로]/[파일명]$(date "+\%Y\%m\%d_\%M").[확장자] # ex * * * * * cp /home/test.html /home/backup/test$(date "+\%Y\%m\..

개인공부/Programmers

[Python] x만큼 간격이 있는 n개의 숫자

x만큼 간격이 있는 n개의 숫자 ( https://programmers.co.kr/learn/courses/30/lessons/12954 ) 스스로 풀어볼 때 try: def solution(x, n): answer = [x] * n for i in range(1, n) : answer[i] = x*i+x return answer x, n = map(int, input().split(" ")) print(solution(x, n)) except EOFError: print(end="") 채점 후 다른 코드를 참고하여 다시 수정할 때 try: def solution(x, n): return [x * i for i in range(1, n+1)] x, n = map(int, input().split(" ")..

개인공부/Baekjoon Online Judge

[Python] 3052번

3052번 - 나머지 ( https://www.acmicpc.net/problem/3052 ) 주석 O # num에 숫자를 10번 입력 받는다. num = [ int(input()) for _ in range(10) ] # 빈 배열을 만든다. result = [] # 반복문을 10번 실행한다. for i in range(10) : # 빈 배열 result에 num에 입력받은 숫자들을 42로 나눈 나머지 값을 넣는다. result.append(num[i] % 42) # count 변수에 result 배열에서 중복을 제거하고 남은 # 배열의 길이를 저장한다. count = len(set(result)) # count를 출력한다. print(count) 주석 X num = [ int(input()) for _..

H E E
'개인공부' 카테고리의 글 목록 (2 Page)