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의 암호를 설정해야 한다.
댓글
댓글 쓰기