前提是Centos的环境是好的,并且相关的软件包已经安装好。

1、创建用户,并修改创建的数据目录的属主

[root@bogon ~]# useradd -M mysql -s /sbin/nologin
[root@bogon ~]# mkdir /data
[root@bogon ~]# chown -R mysql:mysql /data/

2、安装需要的依赖软件

[root@bogon ~]# yum -y install gcc gcc-c++ cmake ncurses-devel perl-Data-dumper openssl-devel

3、上传源码包,并解压安装

[root@bogon ~]# tar -xf mysql-5.6..tar.gz -C /usr/local/src/

[root@bogon ~]# cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/data \
-DWITH_MYISAM_STORAGE_ENGINE=\
-DWITH_INNOBASE_STORAGE_ENGINE=\
-DWITH_ARCHIVE_STORAGE_ENGINE=\
-DWITH_BLACKHOLE_STORAGE_ENGINE=\
-DWITH_MEMORY_STORAGE_ENGINE= \
-DWITH_READLINE= \
-DENABLED_LOCAL_INFILE=\
-DDEFAULT_CHARSET=utf8\
-DDEFAULT_COLLATION=utf8_general_ci\
-DEXTRA_CHARSETS=all\
-DMYSQL_TCP_PORT=\
-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock\
-DWITH_DEBUG= \
-DWITH_SSL=system [root@bogon ~]# make && make install

4、进行简单的配置文件的配置

[root@bogon etc]# rm -rf my.cnf.d/
[root@bogon support-files]# cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf

5、进行安装初始化

[root@bogon scripts]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/

执行结果:

-- ::  [Note] InnoDB: Shutdown completed; log sequence number
OK Filling help tables...-- :: [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
-- :: [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
-- :: [Note] /usr/local/mysql//bin/mysqld (mysqld 5.6.37) starting as process 37140 ...
-- :: [Note] InnoDB: Using atomics to ref count buffer pool pages
-- :: [Note] InnoDB: The InnoDB memory heap is disabled
-- :: [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
-- :: [Note] InnoDB: Memory barrier is not used
-- :: [Note] InnoDB: Compressed tables use zlib 1.2.
-- :: [Note] InnoDB: Using CPU crc32 instructions
-- :: [Note] InnoDB: Initializing buffer pool, size = 128.0M
-- :: [Note] InnoDB: Completed initialization of buffer pool
-- :: [Note] InnoDB: Highest supported file format is Barracuda.
-- :: [Note] InnoDB: rollback segment(s) are active.
-- :: [Note] InnoDB: Waiting for purge to start
-- :: [Note] InnoDB: 5.6. started; log sequence number
-- :: [Note] RSA private key file not found: /data//private_key.pem. Some authentication plugins will not work.
-- :: [Note] RSA public key file not found: /data//public_key.pem. Some authentication plugins will not work.
-- :: [Note] Binlog end
-- :: [Note] InnoDB: FTS optimize thread exiting.
-- :: [Note] InnoDB: Starting shutdown...
-- :: [Note] InnoDB: Shutdown completed; log sequence number
OK
其中出现两个ok是成功的。

6、启动mysql,并把相关命令添加到环境变量中

初始化之后的说明:
New default config file was created as /usr/local/mysql//my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server 配置文件的问题。
[root@bogon scripts]# mysqld_safe --defaults-file=/usr/local/mysql/my.cnf &
[root@bogon scripts]# ps -aux | grep -v grep | grep mysql
root 0.0 0.1 pts/ S : : /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/my.cnf
mysql 0.7 44.8 pts/ Sl : : /usr/local/mysql/bin/mysqld --defaults-file=/usr/local/mysql/my.cnf --basedir=/usr/local/mysql --datadir=/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=bogon.err --pid-file=bogon.pid

7、进行简单的mysql的用户的密码修改。

[root@bogon bin]# mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("") where User='root';
mysql> flush privileges;

8、停止mysql的服务

[root@bogon bin]# mysqladmin -uroot -p shutdown

9、错误

编译错误删除

[root@bogon mysql-5.6.]# rm -rf CMakeCache.txt

centos7 中安装 mysql5.6 的过程的更多相关文章

  1. centos7中安装mysql5.6版本 + 主从复制

    centos安装5.6版本:CentOS7下使用YUM安装MySQL5.6 主从复制:Mysql主从复制与读写分离原理及配置教程 主从复制问题及配置 卸载和安装5.7版本:CentOS 7 安装与卸载 ...

  2. CentOS7中安装MySQL5.7 (转)

    安装必要的组件 yum install –y autoconf automake imake libxml2-devel expat-devel cmake gcc gcc-c++ libaio li ...

  3. CentOS7中安装MySQL5.7

    安装必要的组件 yum install –y autoconf automake imake libxml2-devel expat-devel cmake gcc gcc-c++ libaio li ...

  4. 在centos7中安装MySQL5.7

    1.下载mysql源安装包 wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm 2.安装mysql源 yu ...

  5. 在 CentOS7 上安装 MySQL5.7

    在 CentOS7 上安装 MySQL5.7 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建 ...

  6. [ 原创 ] Centos7.6安装Mysql5.7

    https://blog.csdn.net/shj_php/article/details/86712408 CentOS7下安装MySQL5.7安装与配置(YUM) http://blog.csdn ...

  7. centos7中安装mongodb3.6

    centos7中安装mongodb3.6 首先更新系统 yum -y update 1.安装Mongodb 编辑Mongodb安装源 vim /etc/yum.repos.d/mongodb-org- ...

  8. 在centos7中安装Robot Framework

    安装前景介绍: 最初,我们是在Windows环境下搭建Robot Framework来对我们的服务进行接口测试的(想知道如何在Windows下安装Robot Framework,可以参考我同事的博客h ...

  9. 在centos6.5中安装mysql5.7

    简介 博主最近在研究mysql的读写分离和主从复制,一台master和两台slave,三台机器在同一个局域网中,首先就就要在centos6.5中安装mysql5.7.好了,废话不多说,接下来进入正题. ...

随机推荐

  1. elasticsearch 部署

    环境 ubuntu 12.04 64位 桌面版 jdk 1.7 elasticsearch 2.3.4 伪集群部署 elasticsearch 主目录在 /home/sdbadmin/es-clute ...

  2. shell 截取字符串(转)

    linux中对字符串的处理: 1.字符串分割例如  AAAAA-BBBBBB  按-分割去前后两部分 cut : [rich@localhost ~]$ str=AAAAA-BBBBBB[rich@l ...

  3. A - Wireless Network

    #include <cstdio> #include <algorithm> #include <cstring> #include <iostream> ...

  4. windows下写的shell脚本到linux上不能运行

    win上是dos模式,需要改成unix模式 方法是: 在linux上vim 打开脚本,然后:set ff=unix

  5. php—Spl库常用数据结构基本用法

    数据结构之一 : 栈 //zhan $stack = new SplStack(); $stack->push('data1'); $stack->push('data2'); echo ...

  6. Less学习(2)(完结)

    七.模式匹配与Guard表达式 根据传入参数的不同,引入不同的属性集. .mixin (dark, @color) { color: darken(@color, 10%); } .mixin (li ...

  7. matlab实现gabor滤波器的几种方式

    转自:http://blog.csdn.net/watkinsong/article/details/7882443 方式一: function result = gaborKernel2d( lam ...

  8. Objective-C Composite Objects

    We can create subclass within a class cluster that defines a class that embeds within it an object. ...

  9. ubuntu中使用eclipse开发android,logcat显示问题

    〜/工作区/ .metadata / .plugins / org.eclipse.core.runtime / .settings / com.android.ide.eclipse.ddms.pr ...

  10. hihoCoder #1162 : 骨牌覆盖问题·三 (矩阵快速幂,DP)

    题意:有一个k*n的棋盘,要求用1*2的骨牌来铺满,有多少种方案?(k<8,n<100000001) 思路: 由于k是比较小,但是又不那么小,可以专门构造这样的一个矩阵M,使得只要我们有一 ...