MySQL datetime 날짜로 select하기

MySQL datetime 날짜로 select하기 select 컬럼명 from 테이블명 where date(컬럼명)='2018-01-23'; select 컬럼명 from 테이블명 where 컬럼명 between '2018-01-20' and '2018-01-24'; 위의 2가지 방법이 가장 기본적인 쿼리이다.

APM 구버전 설치 (2) MySQL

%보통 나는 sudo 모드를 사용하지 않고 sudo를 매번 써주면서 한다. (My style)

1.mysql 압축 풀고  폴더로 들어가서

2.Mysql을 실행할 계정을 만든다.

$useradd -M -s /bin/false mysql

3.설치하기

$./configure --prefix=/usr/local/server/mysql --with-extra-charsets=all

$make

$make install



4.MySQL에서 사용할 환경 설정 파일을 /etc에 복사한다.

huge 1~2G
large 512M
medium 64~256M
small 64M미만

$cp support-files/my-huge.cnf /etc/my.cnf

5.MySQL을 관리 할 데이터 베이스를 생성한다.

$sudo /usr/local/server/mysql/bin/mysql_install_db --user=mysql


$chown -R root .
$chown -R var
$chgrp -R mysql .


6.MySQL 명령어를 편하게 사용 할 수 있게 환경변수에 등록한다.

$sudo vi ~/.bash_profile

#path 부분 

PATH=$PATH:$HOME/bin:/usr/local/server/mysql/bin

export PATH
unset USERNAME

#즉시적용

$source ~/.bash_profile

#chkconfig를 이용하여 재부팅이 되어도 MySQL이 자동으로 실행 될 수 있게 설정한다.

$cp share/mysql/mysql.server /etc/init.d/mysqld
$chkconfig -add mysqld

#등록된 것을 확인한다.

$chkconfig --list | grep myslqd
mysqld         0:off     1:off     2:on     3:on     4:on     5:on     6:off



처음으로 MySQL을 실행하면 root의 암호를 설정해야 한다.


댓글

이 블로그의 인기 게시물

3계층 구조( 3 Tier Architecture )

GET방식과 POST방식이란? ( PHP )

MySQL Index태우기가 뭐에요?