1、首先需要编译器gcc 编译器和cmake

yum -y install gcc+ gcc-c++
cd /usr/local/src

wget http://www.cmake.org/files/v3.2/cmake-3.2.1.tar.gz

安装cmake

 [root@xt test]# tar -zxvf  cmake-3.2..tar.gz
[root@xt test]# cd cmake-3.2..tar.gz
[root@xt apr-1.4.]# ./configure --prefix=/usr/local/cmake
[root@xt apr-1.4.]# make && make install

2、下载MySQL5.6.24

wget http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.6/mysql-5.6.24.tar.gz
#解压mysql
tar zxvf mysql-5.6..tar.gz #进入mysql目录
cd mysql-5.6. cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql_data -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE= -DWITH_ARCHIVE_STORAGE_ENGINE= -DWITH_BLACKHOLE_STORAGE_ENGINE= -DWITH_INNOBASE_STORAGE_ENGINE= -DWITH_MEMORY_STORAGE_ENGINE= -DWITH_READLINE= -DMYSQL_TCP_PORT= -DENABLED_LOCAL_INFILE= -DWITH_PARTITION_STORAGE_ENGINE= -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
#编译安装mysql5.
make && make install #新建一个mysql用户
useradd -s /sbin/nologin mysql #新建一个数据目录
mkdir -p /data/mysql_data #赋予权限
chown -R mysql:mysql /usr/local/mysql
chown -R mysql:mysql /data/mysql_data #进入到mysql安装目录
cd /usr/local/mysql/scripts/ #执行以下命令,初始化数据库
./mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql_data --user=mysql #在CentOS6.5系统的最小安装完成后,在/etc目录下会存在一个my.cnf,需要将此文件更名为其他的名字,如:/etc/my.cnf.old,否则,该文件会干扰源码安装的MySQL的正确配置,造成无法启动。
mv /etc/my.cnf /etc/my.cnf.old #复制我们需要的my.cnf到etc下
cp /usr/local/mysql/my.cnf /etc/ #复制启动脚本到/etc/init.d
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld #iptables添加3306端口
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport -j ACCEPT #重启iptables
service iptables restart #启动mysql
service mysqld start #开机启动mysql
chkconfig mysqld on #设置环境变量
vi /etc/profile #在末尾添加以下内容
PATH=/usr/local/mysql/bin:$PATH
export PATH #让刚才的修改生效
source /etc/profile #初始化mysql的一些设置
mysql_secure_installation #回车
Enter current password for root (enter for none): #y,设置mysql的root密码
Set root password? [Y/n] y #以下都yes
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y Thanks for using MySQL! 进入MySQL
[root@****]# /usr/local/mysql/bin/mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.1.-log MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

Centos6.6安装MySQL5.6.24的更多相关文章

  1. CentOS6.5安装MySQL5.6

    CentOS6.5安装MySQL5.6,开放防火墙3306端口,允许其他主机使用root账户密码访问MySQL数据库 查看操作系统相关信息 ** 该查看方法只适用于CentOS6.5 (lsb_rel ...

  2. Windows Server 2012安装mysql5.7.24记录

    系统环境: 一.下载mysql5.7.24安装包 地址:https://dev.mysql.com/downloads/mysql/5.7.html#downloads 下载解压到相应的目录,我的路径 ...

  3. centos6.5安装Mysql5.6及更改密码

    (一) centos6.5安装Mysql5.6 二进制文件安装的方法分为两种: 第一种是不针对特定平台的通用安装方法,使用的二进制文件是后缀为.tar.gz的压缩文件: 第二种是使用RPM或其他包进行 ...

  4. Centos6.5安装MySQL5.6备忘记录

    Centos6.5安装MySQL5.6 1. 查看系统状态 [root@itzhouq32 tools]# cat /etc/issue CentOS release 6.5 (Final) Kern ...

  5. CentOS6.5安装mysql5.7

    CentOS6.5安装mysql5.7 查看mysql的安装路径: [root@bogon ~]# whereis mysql mysql: /usr/bin/mysql /usr/lib/mysql ...

  6. 第三百九十九节,Django+Xadmin打造上线标准的在线教育平台—生产环境部署CentOS6.5安装mysql5.6

    第三百九十九节,Django+Xadmin打造上线标准的在线教育平台—生产环境部署CentOS6.5安装mysql5.6 1.检测系统是否已经安装过mysql或其依赖,若已装过要先将其删除,否则第4步 ...

  7. [转]阿里云CentOS 7.1使用yum安装MySql5.6.24

    阿里云CentOS 7.1使用yum安装MySql5.6.24 作者:vfhky | 时间:2015-06-25 09:43 | 分类:web 在前面两篇文章<2015博客升级记(四):Cent ...

  8. centos6.8安装mysql5.6【转】

    首先先要去看看本机有没有默认的mysql, 本地默认有的,我们应先卸载,在安装新的这个逻辑. rpm -qa | grep mysql 我本机默认安装的mysql5.1.73 下一步删除 rpm -e ...

  9. CentOS7编译安装MySQL5.7.24

    目录 安装依赖 安装boost 编译安装MySQL 配置 登录MySQL,修改密码 安装依赖 (1)cmake是新版MySQL的编译工具 sudo yum install gcc gcc-c++ pc ...

随机推荐

  1. cmd命令行的FTP使用

    进入ftp:ftp 打开连接:open 192.168.1.106 2121 用户名空:none 密码空:不用输入,直接回车 查询远程服务器当前路径:pwd 显示远程服务器当前路径下的文件:dir 远 ...

  2. sqli-labs(27a)

    0X01测试闭合 ?id=" 报错 ?id="" 正常 0X02构造语句爆数据库名称 ?id= 和27关一样 只是 ’ 变成了 ” 其他语法就是打组合拳 0X03组合拳 ...

  3. python基础之 数据格式化

    %还是format 皇城PK Python中格式化字符串目前有两种阵营:%和format,我们应该选择哪种呢? 自从Python2.6引入了format这个格式化字符串的方法之后,我认为%还是form ...

  4. 地图服务 纬度、经度对应坐标轴x,y

    记下,供自己参考,中国地区的经纬度,经度大,纬度小 如上海经纬度为:(经度, 纬度)(y, x)(lon, lat) 121.48 31.22 纬度---lat----x轴 经度---lon---y轴

  5. Cannot connect to the Docker daemon. Is 'docker daemon' running on this host?

    if first time to install docker, be noted the docker engine started as root copied from: http://blog ...

  6. 添加tomcat为启动服务/删除tomcat服务

    在很多生产把环境下,tomcat的启动要随着windows的启动一起启动,这个时候就需要将tomcat添加成服务.步骤如下: 1:环境配置 配置jdk环境变量: JAVA_HOME:jdk路径 配置p ...

  7. socket基本概念

    1.socket 是什么? 在计算机通信领域,socket 被翻译为“套接字”,它是计算机之间进行通信的一种约定或一种方式.通过 socket 这种约定,一台计算机可以接收其他计算机的数据,也可以向其 ...

  8. SpringBoot整合Shiro实现权限控制,验证码

    本文介绍 SpringBoot 整合 shiro,相对于 Spring Security 而言,shiro 更加简单,没有那么复杂. 目前我的需求是一个博客系统,有用户和管理员两种角色.一个用户可能有 ...

  9. Design a stack that supports getMin() in O(1) time and O(1) extra space

    Question: Design a Data Structure SpecialStack that supports all the stack operations like push(), p ...

  10. 解决保存快照失败后redis无法写入的问题( Redis is configured to save RDB snapshots)

    MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Com ...