1. 기존 설치 유무 확인
# rpm -qa | grep mysql
2. 있으면 제거
# rpm -e --nodeps mysql
3. gcc 라이브러리 패키지 설치유무 확인
# rpm -qa | grep gcc
4. 없으면 설치
# yum -y install gcc cpp gcc-c++ compat-gcc-34-g77flex
5. mysql 소스 설치 버전 다운 후 압축 해제
# tar xvfz mysql-version.tar.gz
6. 환경설정 (--localstatedir이 prefix경로뒤에 붙는 경우있음 아래거 복사 붙여넣기 하면 그런듯
타자로 쳐서 실행해야 될 듯 -- 앞에 띄어쓰기 주의 할것 !!!!!!)
./configure --prefix=/usr/local/mysql\
--localstatedir=/usr/local/mysql/data\
--with-named-curses-libs=/usr/lib/libncursesw.so.5\
--with-charset=utf8\
--with-mysql-user=mysql\
--with-plugins=max\
--sysconfdir=/etc\
--enable-thread-safe-client
7.make && make install 실행
완료후 설정 할 사항
1. 사용자 계정생성
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> bin/mysqld_safe --user=mysql &
# cat >> /etc/ld.so.conf
/usr/local/mysql/lib (Ctrl + D 를 눌러 저장종료)
# ldconfig
백그라운드로 실행
# /usr/local/mysql/bin/mysqld__safe --user=mysql &
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
발생시 /usr/local/mysql/bin/mysql_install_db 확인!
부팅시 자동으로 MYSQL 데몬이 작동되로록 하려면 /usr/local/mysql/share/mysql 디렉토리에 존재
하는 mysql.server 파일을 /etc/init.d 디렉토리에 mysql 파일로 복사한 후 chkconfig 명령으로
부팅하는 실행레벨에 맞게 활성화할 수 있도록 처리해 주면 됩니다.
(파일 없으면 소스 압축해제한 디렉토리/support-files 에서 카피해주면 된다
또는 # find / -name mysql.server 로 검색해서 찾아본다.)
# cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
# chkconfig --level 3 mysqld on
# chkconfig --level 5 mysqld on
다른방법
#chkconfig --add mysqld or ntsysv에서 mysqld 체크
#chkconfig --list | mysqld
삭제시 make install 한 경로에서 make uninstall
DataBase/MySQL 2008/07/09 18:13
1.
rpm -qa | grep mysql
rpm -qa | grep apache
rpm -qa | grep httpd
rpm -qa | grep php
rpm -e --nodeps mysql
rpm -e --nodeps apache
rpm -e --nodeps httpd
rpm -e --nodeps pgp
--nodeps : 의존성을 무시하고 강제 삭제
2.
./configure --prefix=/usr/local/mysql \
--localstatedir=/usr/local/mysql/data \
--with-charset=euckr \
make
make install
make install 하시면 /usr/local/mysql 이 설치가 됩니다.
/usr/local/mysql/bin/mysql_install_db 를 실행하시게 되면
/usr/local/mysql/data 가 자동으로 생성이 됩니다.
3.
userdel mysql
useradd -m -s /sbin/nologin -g mysql -d /usr/local/mysql/data mysql
먼저 삭제를 하고 다시 생성을 해보시기 바랍니다.
mysql 계정으로 로그인 금지하며 그룹은 mysql 로 생성합니다.
홈디렉 역시 /usr/local/mysql/data 로 강제 지정이 됩니다.
4.
/usr/local/mysql/data 가 존재하는지 체크를 해보시고...
존재하지 않는다면...
/usr/local/mysql/bin/mysql_install_db
실행하여 /usr/local/mysql/data 생성하시기 바랍니다.
그다음에...
chown -R mysql:mysql /usr/local/mysql/data
라고 명령을 주세요.
vi /etc/profile.d/mysql.sh 로 생성합니다.
내용은 아래와 같습니다.
#/etc/profile.d/mysql.sh
MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin
화일을 저장하신뒤 다음과 같이 적용을 시켜줍니다.
source /etc/profile
굳이 심볼릭 링크를 안주더라도 깔끔하게 언제 어디서건 mysql 을 자유자재로 실행 할수 있습니다
댓글 없음:
댓글 쓰기