准备工作:新建用户和用户组groupadd mysqluseradd -g mysql mysql1:下载:bison-2.4.2.tar.bz2cmake-2.8.3.tar.gzmake-3.82.tar.gzbzr-2.3b5.tar.gzmysql-5.5.8.tar.gz2:解压安装前3个包tar zxvf cmake-2.8.3.tar.gzcd cmake-2.8.3./configuremakemake installtar zxvf make-3.82.tar.gzcd make-3.8.2./configuremakemake installtar jxvf bison-2.4.2.tar.bz2cd bison-2.4.2./configuremakemake install3:解压mysql-5.5.8.tar.gztar zxvf mysql-5.5.8.tar.gzcd mysql-5.5.8cmake . \-DCMAKE_INSTALL_PREFIX=/mysql/mysqldir \-DMYSQL_DATADIR=/mysql/mysqldir/data \-DWITH_INNOBASE_STORAGE_ENGINE=1 \-DMYSQL_TCP_PORT=3306 \-DMYSQL_UNIX_ADDR==/mysql/mysqldir/data/mysql.sock \-DMYSQL_USER=mysql \-DWITH_DEBUG=0报错(如无报错直接make & make install 即可):CMake Error at cmake/readline.cmake:82 (MESSAGE):Curses library not found. Please install appropriate package,remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on RedHat and derivates it is ncurses-devel.Call Stack (most recent call first):cmake/readline.cmake:126 (FIND_CURSES)cmake/readline.cmake:216 (MYSQL_USE_BUNDLED_LIBEDIT)CMakeLists.txt:256 (MYSQL_CHECK_READLINE)-- Configuring incomplete, errors occurred!缺少包:ncurses-devel解决:到安装光盘或者网上DOWN相应的包安装:rpm -ivh ncurses-devel*.rpmrm -f CMakeCache.txtcmake . \-DCMAKE_INSTALL_PREFIX=/mysql/mysqldir \-DMYSQL_DATADIR=/mysql/mysqldir/data \-DWITH_INNOBASE_STORAGE_ENGINE=1 \-DMYSQL_TCP_PORT=3306 \-DMYSQL_UNIX_ADDR==/mysql/mysqldir/data/mysql.sock \-DMYSQL_USER=mysql \-DWITH_DEBUG=0makemake install完成后进入MYSQL安装目录cd /mysql/mysqldircp support-files/my-huge.cnf /etc/my.cnfvi /etc/my.cnf将数据目录和套接字文件修改为实际值.修改权限chown mysql:mysql /etc/my.cnfchown -R mysql:mysql /mysql/mysqldir切换用户进入安装目录su - mysqlcd /mysql/mysqldircp scripts/mysql_install_db ../mysql_install_db启动MYSQLbin/mysqld_safe &OK