编译安装Mysql5.5
mysql5.5采用cmake代替了configure
groupadd mysql -g 27
useradd mysql -u 27 -g 27 -c "MySQL Server" -d /home/mysql -m
wget -c http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.19.tar.gz/from/http://mysql.he.net/
tar zxf mysql-5.5.19.tar.gz
cd mysql-5.5.19
CFLAGS="-O3" CXX=gcc
CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti"
cmake . -DCMAKE_INSTALL_PREFIX=/usr \
-DMYSQL_DATADIR=/home/mysql \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DSYSCONFDIR=/etc \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_DEBUG=0
cp -f support-files/my-medium.cnf /etc/my.cnf
sed -i 's/skip-locking/skip-external-locking/g' /etc/my.cnf
cp -f /usr/share/mysql/mysql.server /etc/init.d/mysqld
ln -s /etc/init.d/mysqld /etc/init.d/mysql
chown -R mysql:mysql /home/mysql
chmod 755 /etc/init.d/mysqld
chmod 755 /home/mysql
chkconfig --add mysqld
chkconfig --level 345 mysql on
mysql_install_db --user=mysql --datadir=/home/mysql --no-defaults &
/etc/init.d/mysqld start
mysqladmin -u root password 密码
紫色部分根据具体情况自行更改定制
none