MySQL5.5.36编译安装

安装依赖环境

yum -y install cmake make gcc gcc-c++  ncurses-devel bison openssl-devel


添加安装数据库账号密码

groupadd abcmysql

useradd -s /sbin/nologin -g abcmysql abcmcysql


下载包解压

wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.36.tar.gz

tar zxvf mysql-5.5.36.tar.gz

cd mysql-5.5.36

cmake . \

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCINFDIR=/etc -DWITH_INNOBASE_STORAGE_ENGINE=1  -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_UNIX_ADDR=/usr/local/mysql/tmp/mysql.sock -DDEFAULT_CHARASET=uft8


make

make install


chown -R abcmysql:abcmysql /usr/local/mysql

cp support-files/my-large.cnf /etc/my.cnf

/usr/local/mysql/scripts/mysql_install_db --user=abcmysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

cp support-files/mysql.server /etc/init.d/mysqld

chmod +x /etc/init.d/mysqld

chkconfig --add mysqld

chkconfig --level 2345 mysqld on

启动mysql

/usr/local/mysql/bin/mysqld_safe --user=abcmysql &








你可能感兴趣的:(mysql安装)