--- Install gcc 與 cmake ---
1.由yum安裝gcc、cmake
shell> yum –y install gcc
2.由yum安裝bison
shell> yum -y install bison
3.將下面的指令做成批次檔 “my_mysql_cmake.sh”
#!/bin/bash
cd ./mysql-5.5.15
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DMYSQL_TCP_PORT=3306 \
-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DWITH_SSL=system \
-DWITHOUT_PARTITION_STORAGE_ENGINE=1 \
-DWITH_DEBUG=0
exit 0
4.下載mysql-5.5.15.tar.gz、解壓縮(shell> tar zxfv mysql-5.5.15.tar.gz),並執行
shell> ./my_mysql_cmake.sh
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
15.shell>bin/mysqld_safe –user=mysql &
=========================================
完成
沒有留言:
張貼留言