标签:
1、安装前准备
1 yum install gcc gcc-c++ ncurses-devel perl 2 yum groupinstall "Development Tools" 3 yum install libxml2-devel bzip2-devel libcurl-devel
2、安装CMake
1 wget https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz 2 tar -zxvf cmake-3.4.1.tar.gz 3 cd cmake-3.4.1 4 ./configure 5 make && make install
3、下载MySQL 5.6
1 wget http://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.28.tar.gz 2 tar -zxvf mysql-5.6.28.tar.gz 3 cd mysql-5.6.28
4、配置编译参数
1 cmake 2 -DCMAKE_INSTALL_PREFIX=/usr/local/mysql 3 -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock 4 -DDEFAULT_CHARSET=utf8 5 -DDEFAULT_COLLATION=utf8_general_ci 6 -DWITH_INNOBASE_STORAGE_ENGINE=1 7 -DWITH_ARCHIVE_STORAGE_ENGINE=1 8 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 9 -DMYSQL_DATADIR=/data/mysqldb 10 -DMYSQL_TCP_PORT=3306 11 -DENABLE_DOWNLOADS=1
5、编译安装(时间比较久)
make && make install
6、配置用户组
1 groupadd mysql 2 useradd -r -g mysql mysql
7、建立数据库目录(/data/mysqldb)
mkdir -p /data/mysqldb
8、更改权限
1 chown -R mysql:mysql /usr/local/mysql 2 chown -R mysql:mysql /data/mysqldb
9、配置文件默认位置/usr/local/mysql/my.cnf(删除/etc/my.cnf)
1 rm /etc/my.cnf 2 chown mysql:mysql /usr/local/mysql/my.cnf
10、启动MySQL
1 cp support-files/mysql.server /etc/init.d/mysqld 2 /etc/init.d/mysqld start
启动成功会出现
Starting MySQL. SUCCESS!
11、运行安全设置脚本
/usr/local/mysql/bin/mysql_secure_installation
标签:
原文地址:http://www.cnblogs.com/imzye/p/5080812.html