MariaDB 한글 insert 안 될 때

이미지
charset을 확인 하는데 먼저 글로벌 확인하기. 보는것과 같이 퍼킹하게 character_set_database 가 latin1으로 되어있다. 그리고 해당 테이블도 확인 해보자. 역시 퍼킹하게 테이블도 latin1로 되어있다. 먼저 글로벌 charset 설정을 바꿔준다.. /usr/local/etc 밑으로 가서 my.cnf를 바꾼다. 그리고 재시작 해주고 다시 글로벌 charset 확인하기 mysql.server stop mysql.server start server가 잘 안 꺼질땐 sudo mysqladmin shutdown 글로벌설정을 바꿔주어도 테이블은 영향 받지 않기 때문에 테이블 레벨에서 해당 테이블의 charset도 변경해준다. 변경이 잘 된 것을 확인할 수 있따리!

Mac MariaDB 서버 시작 시 뜨는 에러

이미지
우선 Mac 에 brew와 mariaDB가 설치 되어 있다는 전제가 깔려있다. $ brew list 하면 내가 설치한 목록이 나온다. mysql.server status - DB 서버가 돌고 있는지 확인하기 mysql.server start - DB 서버 시작시키기 mysql.server stop - DB 서버 중지시키기 이다. 시작 시키려고 하는데 아래와 같이 에러 메시지가 나온다. namdong-gil-ui-MacBookPro:~ namdong-gil$ mysql.server start /usr/local/Cellar/mariadb/10.3.13/bin/my_print_defaults: Can't read dir of '/usr/local/etc/my.cnf.d' (Errcode: 2 "No such file or directory") Fatal error in defaults handling. Program aborted Starting MariaDB /usr/local/Cellar/mariadb/10.3.13/bin/my_print_defaults: Can't read dir of '/usr/local/etc/my.cnf.d' (Errcode: 2 "No such file or directory") Fatal error in defaults handling. Program aborted ./usr/local/Cellar/mariadb/10.3.13/bin/my_print_defaults: Can't read dir of '/usr/local/etc/my.cnf.d' (Errcode: 2 "No such file or directory") Fatal error in defaults handling. Program aborted 190914 15:07:41 mysqld_safe L...

Spring cloud zuul proxy - API gateway

이미지
요즘 MSA(Micro Service Architecture) 에 빠져서 이것 저것 건드려 보고 있다. 그러다가 zuul proxy라는 걸 알게되어서 끄적끄적 대다가 만져봤는데, 재미있어서 오랜만에~ 블로깅하려고 한다. 원래 그동안 한 건 많은데 뭔가 정리하기 너무 귀찮은데 이건 방금 해서 아 이참에 다시 블로깅 시작해야지 하는 맘에 올린다. 간단하게, zuul 이 뭐하는 놈인가 봤더니, 일단 proxy가 뭐냐? 대략 위키나 구글링 해보면, 서버와 클라이언트 사이에서 중계기 역할을 한다고 한다. proxy 서버의 역할은 캐싱 및 라우팅 역할이 제일 큰 것 같다. 클라이언트로 부터 요청이 들어왔을 때 수많은 서비스들 중에 어디 서비스로 찔러줄건지 교통정리 해주거나(?) 여러 번 요청 들어온 거는 캐싱해놨다가 뭐 빠르게 응답을 주는 등 리소스 관리에도 도움을 줄 수 있는 것 같다. 짧고 짧은 나의 생각에서 정리해 보았다. 그래서 zuul이 뭔가 했더니 대략 위에 것들을 쉽게(?) 해줄 수 있도록 해주는데 넷플릭스에서 만들었다고 했나? 암튼 많이들 쓰는 것 같다. 더 공부 해야 겠다. 지금 부터는 대략 끄적여 본 것을 나열 해봐야겠다. 먼저 spring boot Maven 프로젝트 2개를 만든다. 하나는 zuul proxy server 로 port 는  8080 나머지 하나는 레알 찐탱 간단하게 REST API(?)라고 하기에 민망한 서버로 port 는 8081 로 만든다. 먼저 proxy server에서 Maven에 디펜던시 추가 그 다음에는, application.yml 에다가 라우팅 설정을 해준다. /foos/** 에 매칭되는 path는 전부 http://localhost:8081/foos 로 라우팅 해주겠다는 설정이다. 그리고 @EnableZuulProxy 붙여주고 마지막으로 ZuulFilter를 상속받아 컴포넌트를 만들어 준다. type 설정해주고, order...

org.apache.jasper.JasperException: JSP를 위한 클래스를 컴파일할 수 없습니다.

이미지
블로깅을 쉰 지 너무 오래되서 그런가... 그동안 공부한 건 많은데 왜이리 정리하기가 귀찮은지 다시 시작하려고 새로운 환경설정 잡다가 가끔씩 마주치는 경우 때문에 블로깅을 해보려고 한다. 아래 메세지가 뜨면서 jsp를 컴파일 할 수 없다고 할 경우 The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit tomcam 경로에 web.xml 에 org.apache.jasper.servlet.JspServlet가 잘 등록? 되어 있는지 확인한다. 그리고 있다면, 아래의 설정이 없어서 그렇다. 아래의 설정을 추가 해준다. <init-param> <param-name>mappedfile</param-name> <param-value>false</param-value> </init-param> 아래의 링크에 mappedfile 설정 true / false를 잘 비교해 주고 있다. https://dololak.tistory.com/478

Spring boot 에서 selenium 라이브러리 디펜던시 Exception

이미지
Slack Bot을 만들어 볼까 해서 집에 있는 나스에 spring boot로 올리려고 했다. 그래서 좋은 웹 크롤러 라이브러리가 뭐가 있나 찾아보다가 selenium이라고 아주 깔쌈한 걸 찾아서 사용해보려고 했다가 알 수 없는 예외 때문에 하루를 그냥 날려버렸다. 일단 Gradle dependencies에 추가 compile group : 'org.seleniumhq.selenium' , name : 'selenium-java' , version : '3.141.59' 일단 selenium을 쓰려면 WebDriver를 사용한다. WebDriver도 브라우저마다 다양하게 지원된다. FireFox, Chrome, Opera, IE, Edge, Safari 이렇게 지원해주나? 그 중에서도 나는 Chrome driver를 사용하려고 했다. http://chromedriver.chromium.org/downloads 여기서 driver를 다운 받는데, 제일 중요한 점! 본인 컴터에 깔린 크롬 버전에 맞게 다운받아야된다. 아니면  java.lang.IllegalAccessError: tried to access class org.openqa.selenium.os.ExecutableFinder  예외를 맞닥뜨리게 된다. 혹은 아래에 나오는 경로를 잘못 잡아줘도 같은 예외를 맞닥뜨린다. 내가 다운로드 한 버전은 74 Driver 객체 생성하기 전에 아래 처럼 다운 받은 chromedriver 경로를  system property에 잡아줘야된다. 여기까지는 금방금방 진행이 되었다. System. setProperty ( "webdriver.chrome.driver" , "/Users/namdong-gil/Downloads/chromedriver" ) ; WebDriver driver = new ChromeDriver() ; 하지만 아래에...

Spring javax.mail 사용 시 javax.mail.AuthenticationFailedException 발생 해결

이미지
분명히 내가 username 이랑 password가 맞는데 javax.mail.AuthenticationFailedException 발생 한다면, 아래로 들어가서 해당 계정을 허용 해줘라 https://www.google.com/settings/security/lesssecureapps

HackerRank Java New Year Chaos

이미지
문제풀기 :  https://www.hackerrank.com/challenges/new-year-chaos/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=arrays&h_r=next-challenge&h_v=zen It's New Year's Day and everyone's in line for the Wonderland rollercoaster ride! There are a number of people queued up, and each person wears a sticker indicating their   initial   position in the queue. Initial positions increment by     from     at the front of the line to     at the back. Any person in the queue can bribe the person   directly in front   of them to swap positions. If two people swap positions, they still wear the same sticker denoting their original places in line. One person can bribe   at most two others . For example, if     and     bribes   , the queue will look like this:   . Fascinated by this chaotic queue, you decide you must know the minimum number of bribes th...