1、安装编译依赖
yum install -y libaio libaio-devel cmake ncurses-devel perl
2、编译安装
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/data/mysqldb -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1 -DSYSCONFDIR=/usr/local/mysql/ make make install
3、新建用户和组
groupadd mysql useradd mysql -g mysql
4、新建目录,修改目录权限
mkdir /data/mysqldb chown -R mysql.mysql /usr/local/mysql chown -R mysql.mysql /data/mysqldb
5、创建启动文件
cd /usr/local/mysql/scripts/ ./mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysqldb --user=mysql cp support-files/mysql.server /etc/init.d/mysqld chkconfig mysqld on /etc/init.d/mysqld start
6、启动
su - mysql service mysqld start
本文出自 “千面” 博客,请务必保留此出处http://oslibo.blog.51cto.com/10854638/1827770
原文地址:http://oslibo.blog.51cto.com/10854638/1827770