그냥 단순히 finally에 return이 있으면 finally 없으면 try나 catch구문의 return

이라고 이해해도 사용은 가능 하지만

실제로는 결정 과정이 좀 복잡하다.

According to ECMA-262 (5ed, December 2009), in pp. 96:

The production TryStatement : try Block Finally is evaluated as follows:

  1. Let B be the result of evaluating Block.
  2. Let F be the result of evaluating Finally.
  3. If F.type is normal, return B.
  4. Return F.

And from pp. 36:

The Completion type is used to explain the behaviour of statements (break, continue, return and throw) that perform nonlocal transfers of control. Values of the Completion type are triples of the form (type, value, target), where type is one of normal, break, continue, return, or throw, value is any ECMAScript language value or empty, and target is any ECMAScript identifier or empty.

It's clear that return false would set completion type of finally as return, which cause try ... finally to do 4. Return F.

 

참조: https://stackoverflow.com/questions/3837994/why-does-a-return-in-finally-override-try

'javascript' 카테고리의 다른 글

javascript] bind vs wrapper  (0) 2018.11.17
callback 패턴 함수를 await로 쓰는 방법  (0) 2018.05.01
nodeJs require  (0) 2018.04.13
함수형 프로그래밍 : reduce  (0) 2018.04.07
promise 대신 async, await를 사용하자  (0) 2018.03.22

엉뚱한 곳에서 설정이 덮어져서 설정을 아무리 고쳐도 반응을 안할 때가 있다.
끔찍한 뻘짓인데
지난번 router cors설정하다가 한번 그러고
이번에는 logger설정하다 또 그랬다.
그래도 이번에는 좀 딥한 설정방법을 알아낸건 다행?
은 무슨 앞으로 안쓸 것 같다. 그래도 이런 것도 있다는 정리

{
  "appenders": {
    "default": {
      "type": "stdout"
    },
    "default-filter": {
      "type": "logLevelFilter",
      "appender": "default",
      "level": "DEBUG",
      "maxlevel": "ERROR"
    },
    "error": {
      "type": "dateFile",
      "filename": "log/server/error.log"
    },
    "error-filter": {
      "type": "logLevelFilter",
      "appender": "error",
      "level": "ERROR",
      "maxlevel": "ERROR"
    }
  },
  "categories": {
    "default": {
      "appenders": ["default-filter", "error-filter"],
      "level": "INFO"
    }
  }
}```

appender에 logLevelFilter를 걸면 후킹하는 것처럼 최종 설정을 가로챌 수 있다.
이렇게 해놓고 또 반대로 설정 안바뀐다고 뻘짓 안했으면 좋겠다.
왜 제일 마지막에 있는 logger.level = 'debug'를 못봤을 까
그래서 처음할 때 바쁘다고 대충 때려 박으면 이렇게 된다.

mysql에서는 자세히 설명해주지 않고 번호로만 에러 종류를 알려준다.

  1. 2 해당경로에 mysql.sock 파일이 없을 경우
    my.cnf socket경로가 잘못되어이을 경우 그렇다.
    mysqld에서 띄운 소켓경로와
    mysql에서 찾는 소켓경로가 같아야 한다.
    계속 엉뚱한 경로를 찾는다면 cnf파일을 직접 지정해준다.
    mysql --defaults-file='소켓경로'

  2. 61
    mysql 원격 접속은 clinet ip별로 user가 생성이 돼서 host별 user를 만들어줘야 한다.

    create user '[username]'@'[hostname]' identified by '[password]';
    flush privileges;

    flush를 안해주면 create user가 적용이 안된다.
    hostname은 %를 사용하면 모든 hostname이 적용이 된다.

'Infra > database' 카테고리의 다른 글

Postgres function code 보는 법  (0) 2020.10.14
postgres 실행이 안될 경우  (0) 2020.10.12
MYSQL] my.cnf 위치 찾기  (0) 2020.07.17
mysql 수동 설치  (0) 2019.09.15

linux - genetic mysql 8.0 download link
[https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.17-linux-glibc2.12-x86\_64.tar.xz]

내가 설치할 환경은 kt-cloud의 ubuntu 16.0.4였다.
mysql community server download 로 검색하면 환경별 다운로드 링크를 찾을 수 있다.

서버에서 설치할 경우 url이 필요한데 download클릭은 오라클 로그인 유도페이지로 간다.
No thanks, just start my download. 를 우클릭해서 url을 복사하고
bashshell wget [https://dev.mysql.com](https://dev.mysql.com)/get/Downloads/MySQL-8.0/mysql-8.0.17-linux-glibc2.12-x86\_64.tar.xz
와 같이 다운 받을 수 있다.

압출을 풀고나서 mysql을 이용할 수 있는 몇가지 환경이 필요하다.

  1. my.cnf 만들기
    [mysqld]
    basedir=
    datadir=
    socket=
    bind-address=0.0.0.0
    user=ksw

  2. mysqld 초기화하기

    mysqld --defaults-file=[my.cnf경로] --intialize
  3. mysqld 띄우기
    mysqld --defaults-file=[my.cnf경로]

2~3으로 연결되는 부분이 이상하다.
공식 문서에는 2번을 하면 mysql ps가 떠있는 걸로 말하는데
실제로는 따로 실행해야 하고 defaults-file도 계속 지정해줘야 한다.
뭔가 불편한 것다.
datadir설정하라고 나와서 따라 했더니 그냥 default로 써야 하는 건가라는 생각이 든다.
그런데 default로 쓰면 var/lib같은 곳 소유권을 넘겨주거나 db용 계정을 sudoer로 만들어야 하니
이 또한 권장사항하고 안맞는다.
뭘 잘못한 건지 누가 좀 가르쳐 줬으면 좋겠다.

 

참조

https://askubuntu.com/questions/1092775/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-var-run

 

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

While entering MySQL server I am getting an error like this: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) What's the problem and how ...

askubuntu.com

If your file my.cnf (usually in the /etc/mysql/ folder) is correctly configured withsocket=/var/lib/mysql/mysql.sock

you can check if mysql is running with the following command:

mysqladmin -u root -p status

try changing your permission to mysql folder. If you are working locally, you can try:

sudo chmod -R 755 /var/lib/mysql/

 

https://stackoverflow.com/questions/5376427/cant-connect-to-local-mysql-server-through-socket-var-mysql-mysql-sock-38

 

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38)

I am having a big problem trying to connect to mysql. When I run: /usr/local/mysql/bin/mysql start I have the following error : Can't connect to local MySQL server through socket '/var/mysql/mysql.

stackoverflow.com

https://askubuntu.com/questions/125686/failed-to-spawn-mysql-main-process-unable-to-execute-no-such-file-or-director

 

"Failed to spawn mysql main process: unable to execute: No such file or directory"

I'm a newbie on MySQL ground so bear with me. I've just finished upgrading 11.10 to 12.04. Everything seemed to work without any hiccups and all my software and settings are working fine. Apart f...

askubuntu.com

 

'Infra > database' 카테고리의 다른 글

Postgres function code 보는 법  (0) 2020.10.14
postgres 실행이 안될 경우  (0) 2020.10.12
MYSQL] my.cnf 위치 찾기  (0) 2020.07.17
Can't connect to MySQL server  (0) 2019.09.15
  1. nested join
  2. hash table
  3. merged table (sort order)
    sort시켜놓고 필요 없는 부분은 검색하지 않는다.

맥은 brew로 간단하게 설치한다.

brew nginx

 

기본 포트 설정이 8080이다.

 

/usr/local/etc/nginx/nginx.conf 파일에서

 

server {
        listen       8080;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

 

이부분을 수정하면 된다.

root html 은 --prefix=/usr/local/Cellar/nginx/1.17.3

적용을 받는다.

html은 /usr/local/var/www 의 링크다.

 

'개발환경 설정 > mac' 카테고리의 다른 글

폴더  (0) 2019.08.21
  • /usr/local/bin
    brew, npm, mysql 같은 사용자 설치 프로그램들 링크가 있다.

'개발환경 설정 > mac' 카테고리의 다른 글

install nginx  (0) 2019.08.21

docker build -t crazywook/cheers2019 .

docker login

공홈에는 . 이 없다. 현재 폴더라는 것을 명시해줘야 한다.

 

docker push crazywook/cheers2019

를 하면

requested access to the resource is denied

라고 뜬다.

docker login docker.io

로 로그인하면 정상적인 푸쉬가 된다.

 

vue-if는 rendering자체가 안되고

vue-show 는 display: none으로 감춘다.

npm i @babel/core @babel/preset-env -D

 

npm i babel 한다고 core가 설치되지는 않는다.

각각 설치해야 한다.

 

+ Recent posts