2011년 6월 14일 화요일

mysql 5.5.13 설치시 cmake


mysql 5.x부터 설치 방법이 변경되었다.
./configure가 없고 cmake를 이용. ( gcc , g++ 설치 필요)

   # cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DWITH_EXTRA_CHARSETS=all -DMYSQL_DATADIR=/usr/local/mysql/data -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DSYSCONFDIR=/etc -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DMYSQL_TCP_PORT=3306

# make && make install
# cp support-files/my-huge.cnf /etc/my.cnf            <---mysql 설정파일 복사
# cp support-files/mysql.server /etc/init.d/mysqld    <---mysql 실행데몬 복사     
# vi /etc/init.d/mysqld
--------------------------------------
datadir=/usr/local/mysql/data              
---------------------------------------
data디렉토리에서 파일 소유권을 mysql로 준다.
chown -R mysql:mysql *


# chmod 755 /etc/init.d/mysqld             <---mysql 데몬 실행 권한 부여
# chown -R mysql:mysql /usr/local/mysql              
# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data                             <---DB생성
# /etc/init.d/mysqld start                     <---mysql 구동 (시작)  또는 /usr/local/server/mysql/bin/mysqld_safe &
# chkconfig --add mysqld                    
# /usr/local/mysql/bin/mysqladmin -u root password 암호        

mysql.sock오류 발생시 파일 확인. ( mysql.sock은 유닉스 소켓연결시 사용. )
bin 폴더에서 
#mysql_config --socket


mysql_config 없다고 메세지 발생시.

#sudo apt-get install libmysqlclient-dev


# ln -s /usr/local/mysql/bin/mysql /usr/bin/                           <---링크
# ln -s /usr/local/mysql/bin/mysqldump /usr/bin/

 3) mysql 접속

# mysql -u root -p                 <---mysql 접속
------------------------------------------------------------------------------------
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.10-log Source distribution
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
---------------------------------------------------------------------------------------

댓글 없음:

댓글 쓰기