본문 바로가기
카테고리 없음

Mariadb + Redis [session control]

by boolean 2017. 9. 2.
728x90

Cannot set property 'key' of undefined. 

The unnecessary phrases are redundantly defined or the order of implementation of each element is tangled.

Remove all new features and slowly redefine them.

필요 없는 문구들이 중복 정의 되어 있거나 각 요소들의 구현 순서가 엉킨 경우이다 . 

새롭게 추가된 기능을 모두 제거후 천천히 다시 정의하자.


Mariadb + Redis [session control]

// Create node js project

$mkdir  testSession

$cd testSession

$vi index.js

$vi package.json

$mkdir views

$cd views

$vi index.html

$vi home.html

$cd ../

$node index.js


//Create database

CREATE SCHEMA IF NOT EXISTS `redis_demo` DEFAULT CHARACTER SET latin1 ;

USE `redis_demo` ;


-- -----------------------------------------------------

-- Table `redis_demo`.`user_login`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `redis_demo`.`user_login` (

  `user_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '',

  `user_email` VARCHAR(50) NOT NULL COMMENT '',

  `user_password` VARCHAR(50) NOT NULL COMMENT '',

  `user_name` VARCHAR(50) NOT NULL COMMENT '',

  PRIMARY KEY (`user_id`)  COMMENT '',

  UNIQUE INDEX `user_email` (`user_email` ASC)  COMMENT '')

ENGINE = InnoDB

AUTO_INCREMENT = 7

DEFAULT CHARACTER SET = latin1;


-- -----------------------------------------------------

-- Table `redis_demo`.`user_status`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `redis_demo`.`user_status` (

  `user_id` INT(11) NOT NULL COMMENT '',

  `user_status` TEXT NOT NULL COMMENT '',

  `created_date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',

  INDEX `user_id` (`user_id` ASC)  COMMENT '',

  CONSTRAINT `user_status_ibfk_1`

    FOREIGN KEY (`user_id`)

    REFERENCES `redis_demo`.`user_login` (`user_id`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = latin1;

testSession/package.json

testSession/index.js

testSession/views/home.html

JS Bin on jsbin.com

testSession/views/index.html

댓글