2011年6月1日 星期三

MySQL 5.5.13 Install from Source (2011-08-11 modified)

--- Install cmake ---
1. Go http://www.cmake.org and download cmake-2.8.4.tar.gz
2. Check  for the existing of gcc & gcc++ compiler.  If not, install it first.
    shell> yum  -y   install   gcc
    shell> yum  -y   install   gcc-c++
3. shell> tar   zxfv   cmake-2.8.4.tar.gz
4. shell> cd   cmake-2.8.4
5. shell> ./configure && make && make install


--- install ncurses-devel ---
shell> yum   -y   install   ncurses-devel


--- Install  bison  ---
1. Go http://www.gnu.org/software/bison/ and download bison-2.5.tar.gz
2. shell> tar   zxfv bison-2.5.tar.gz
3. shell> cd   bison-2.5
4. shell> ./configure && make && make   install

--- Configure MySQL 5.5.13 ---
1. Download mysql-5.5.13.tar.gz
2. shell> tar   zxfv mysql-5.5.13.tar.gz
3. shell> cd   mysql-5.5.13
4. shell> cmake   -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
        -DMYSQL_DATADIR=/usr/local/mysql/data \
        -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \
        -DWITH_MYISAM_STORAGE_ENGINE=1 \
        -DWITH_INNOBASE_STORAGE_ENGINE=1 \
        -DWITH_ARCHIVE_STORAGE_ENGINE=1 \
        -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
        -DENABLED_LOCAL_INFILE=1 \
        -DDEFAULT_CHARSET=utf8 \
        -DDEFAULT_COLLATION=utf8_general_ci \
        -DEXTRA_CHARSETS=all \
        -DMYSQL_TCP_PORT=3306 
 # X       -DMYSQL_USER=mysql       <--  This line would cause a warning message, and take it out. 

5. shell> make  &&  make   install
---------------------------------
6. shell> groupadd   mysql
7. shell> useradd   -r   -g   mysql mysql
8. shell> cd   /usr/local/mysql
9. shell> chown   -R   mysql   . 
10.shell> chgrp   -R   mysql   . 
11.shell> scripts/mysql_install_db   --user=mysql
12.shell> chown   -R   root   . 
13.shell> chown   -R   mysql data
14.shell
cp  support-files/my-medium.cnf    /etc/my.cnf

沒有留言: