til
  • Introduction
  • Clojure
    • usage
    • lein
    • luminus
    • web
    • 4clojure
    • testing
  • Emacs-spacemacs
  • DB
    • mongodb
    • mysql
  • TDD study
    • 25장-테스트 주도 개발 패턴
    • 26-빨간막대패턴
    • 27-테스팅패턴
    • 28-초록막대패턴
    • 29-xUnit패턴
  • Util
  • Raft
    • 발표내용
    • 논문번역
  • Node.js
  • Security
    • 인코딩/디코딩
    • 암복호화 알고리즘
    • 공개키 알고리즘
  • 임시저장페이지
Powered by GitBook
On this page
  • [mac] [brew]로 설치한 mysql 클린 삭제하기
  • json 컬럼을 쓰는 table 생성하기
  • specifc typo (=> specific)
  • DB 생성하기 커맨드
  • TIMZONE 확인하기 쿼리
  • 테이블 내용 모두 삭제하기
  • 테이블 데이터 갯수
  1. DB

mysql

PreviousmongodbNextTDD study

Last updated 6 years ago

[mac] [brew]로 설치한 mysql 클린 삭제하기

  • 사정이 있어서 삭제를 하려고 brew uninstall mysql (또는 brew remove mysql) 하려는데, 제 설치하면 옛날 비번을 물어본다.

  • 클린 삭제&설치가 필요하다!!

# mysql clean 삭제

ps -ax | grep mysql
brew remove mysql
brew cleanup
sudo rm -rf /usr/local/var/mysql

이렇게하고 brew install mysql 하면 깔끔하게 새 설치가 된다.

json 컬럼을 쓰는 table 생성하기

CREATE TABLE table_name (
    col_name JSON
);

specifc typo (=> specific)

풀리케날리고싶다. 이슈라도 적고싶다. oracle 가입을 해야해서 매우 허들.

DB 생성하기 커맨드

create database [DB명];

TIMZONE 확인하기 쿼리

mysql> select now();
+——————————+
| now()               |
+——————————+
| 2018-05-24 15:43:44 |
+——————————+
1 row in set (0.00 sec)

mysql> select @@global.time_zone;
+——————————+
| @@global.time_zone |
+——————————+
| SYSTEM             |
+——————————+
1 row in set (0.00 sec)

mysql>  select @@session.time_zone;
+——————————+
| @@session.time_zone |
+——————————+
| SYSTEM              |
+——————————+
1 row in set (0.00 sec)

테이블 내용 모두 삭제하기

delete from table_name;

테이블 데이터 갯수

select count(*) from table_name;
https://github.com/mysql/mysql-connector-j/blob/b3cda4f864902ffdde495b9df93937c3e20009be/src/com/mysql/jdbc/LocalizedErrorMessages.properties