mysql-5.6.28 整个安装过程详细教程,详解

先创建普通用户
[[email protected] home]# useradd -d /home/sh -m sh
[[email protected] home]# passwd sh
更改用户 sh 的密码 。
新的 密码:
无效的密码: 它基于字典单词
重新输入新的 密码:
passwd: 所有的身份验证令牌已经成功更新。
[[email protected] home]# su sh
[[email protected] home]$ cd /home/sh/
[[email protected] ~]$ mkdir webapps bin conf src app local tomcat
[[email protected] ~]$ ll
总用量 28
drwxrwxr-x. 2 sh sh 4096 4月  26 01:55 app
drwxrwxr-x. 2 sh sh 4096 4月  26 01:55 bin
drwxrwxr-x. 2 sh sh 4096 4月  26 01:55 conf
drwxrwxr-x. 2 sh sh 4096 4月  26 01:55 local
drwxrwxr-x. 2 sh sh 4096 4月  26 01:55 src
drwxrwxr-x. 2 sh sh 4096 4月  26 01:55 tomcat
drwxrwxr-x. 2 sh sh 4096 4月  26 01:55 webapps

然后利用FileZilla上传cmake-2.8.10.2.tar.gz,libevent-1.2.tar.gz,mysql-5.6.28.tar.gz

或者下载
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz/from/http://cdn.mysql.com/

查看已经装的版本
[[email protected] src]$ rpm -qa | grep mysql
mysql-5.1.73-3.el6_5.x86_64
mysql-libs-5.1.73-3.el6_5.x86_64
mysql-connector-odbc-5.1.5r1144-7.el6.x86_64

[[email protected] home]# rpm -qa | grep mysql
mysql-5.1.73-3.el6_5.x86_64
mysql-libs-5.1.73-3.el6_5.x86_64
mysql-connector-odbc-5.1.5r1144-7.el6.x86_64
[[email protected] home]# yum remove mysql-libs-5.1.71-1.el6.x86_64
已加载插件:fastestmirror, security
设置移除进程
参数 mysql-libs-5.1.71-1.el6.x86_64 没有匹配
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: centos.ustc.edu.cn
 * updates: centos.ustc.edu.cn
base                                                                                               | 3.7 kB     00:00
extras                                                                                             | 3.4 kB     00:00
extras/primary_db                                                                                  |  37 kB     00:00
updates                                                                                            | 3.4 kB     00:00
updates/primary_db                                                                                 | 4.7 MB     00:03
不删除任何软件包
[[email protected] home]# rpm -qa | grep mysql
mysql-5.1.73-3.el6_5.x86_64
mysql-libs-5.1.73-3.el6_5.x86_64
mysql-connector-odbc-5.1.5r1144-7.el6.x86_64
[[email protected] home]# yum remove mysql-5.1.73-3.el6_5.x86_64
已加载插件:fastestmirror, security
设置移除进程
解决依赖关系
--> 执行事务检查
---> Package mysql.x86_64 0:5.1.73-3.el6_5 will be 删除
--> 完成依赖关系计算

依赖关系解决

==========================================================================================================================
 软件包           架构              版本                        仓库                                                 大小
==========================================================================================================================
正在删除:
 mysql            x86_64            5.1.73-3.el6_5              @anaconda-CentOS-201410241409.x86_64/6.6            2.4 M

事务概要
==========================================================================================================================
Remove        1 Package(s)

Installed size: 2.4 M
确定吗?[y/N]:y
下载软件包:
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
  正在删除   : mysql-5.1.73-3.el6_5.x86_64                                                                            1/1
  Verifying  : mysql-5.1.73-3.el6_5.x86_64                                                                            1/1 

删除:
  mysql.x86_64 0:5.1.73-3.el6_5                                                                                           

完毕!
[[email protected] home]# rpm -qa | grep mysql
mysql-libs-5.1.73-3.el6_5.x86_64
mysql-connector-odbc-5.1.5r1144-7.el6.x86_64
[[email protected] home]# yum remove mysql-libs-5.1.73-3.el6_5.x86_64
已加载插件:fastestmirror, security
设置移除进程
解决依赖关系
--> 执行事务检查
---> Package mysql-libs.x86_64 0:5.1.73-3.el6_5 will be 删除
--> 处理依赖关系 libmysqlclient.so.16()(64bit),它被软件包 2:postfix-2.6.6-6.el6_5.x86_64 需要
--> 处理依赖关系 libmysqlclient.so.16(libmysqlclient_16)(64bit),它被软件包 2:postfix-2.6.6-6.el6_5.x86_64 需要
--> 处理依赖关系 libmysqlclient_r.so.16()(64bit),它被软件包 mysql-connector-odbc-5.1.5r1144-7.el6.x86_64 需要
--> 处理依赖关系 libmysqlclient_r.so.16()(64bit),它被软件包 MySQL-python-1.2.3-0.3.c1.1.el6.x86_64 需要
--> 处理依赖关系 libmysqlclient_r.so.16(libmysqlclient_16)(64bit),它被软件包 mysql-connector-odbc-5.1.5r1144-7.el6.x86_64 需要
--> 处理依赖关系 libmysqlclient_r.so.16(libmysqlclient_16)(64bit),它被软件包 MySQL-python-1.2.3-0.3.c1.1.el6.x86_64 需要
--> 处理依赖关系 mysql-libs,它被软件包 2:postfix-2.6.6-6.el6_5.x86_64 需要
--> 执行事务检查
---> Package MySQL-python.x86_64 0:1.2.3-0.3.c1.1.el6 will be 删除
---> Package mysql-connector-odbc.x86_64 0:5.1.5r1144-7.el6 will be 删除
---> Package postfix.x86_64 2:2.6.6-6.el6_5 will be 删除
--> 处理依赖关系 /usr/sbin/sendmail,它被软件包 redhat-lsb-core-4.0-7.el6.centos.x86_64 需要
--> 处理依赖关系 /usr/sbin/sendmail,它被软件包 cronie-1.4.4-12.el6.x86_64 需要
--> 执行事务检查
---> Package cronie.x86_64 0:1.4.4-12.el6 will be 删除
--> 处理依赖关系 cronie = 1.4.4-12.el6,它被软件包 cronie-anacron-1.4.4-12.el6.x86_64 需要
---> Package redhat-lsb-core.x86_64 0:4.0-7.el6.centos will be 删除
--> 处理依赖关系 redhat-lsb-core(x86-64) = 4.0,它被软件包 redhat-lsb-printing-4.0-7.el6.centos.x86_64 需要
--> 处理依赖关系 redhat-lsb-core(x86-64) = 4.0-7.el6.centos,它被软件包 redhat-lsb-4.0-7.el6.centos.x86_64 需要
--> 处理依赖关系 redhat-lsb-core(x86-64) = 4.0,它被软件包 redhat-lsb-graphics-4.0-7.el6.centos.x86_64 需要
--> 执行事务检查
---> Package cronie-anacron.x86_64 0:1.4.4-12.el6 will be 删除
---> Package redhat-lsb.x86_64 0:4.0-7.el6.centos will be 删除
--> 处理依赖关系 redhat-lsb(x86-64) = 4.0-7.el6.centos,它被软件包 redhat-lsb-compat-4.0-7.el6.centos.x86_64 需要
---> Package redhat-lsb-graphics.x86_64 0:4.0-7.el6.centos will be 删除
---> Package redhat-lsb-printing.x86_64 0:4.0-7.el6.centos will be 删除
--> 执行事务检查
---> Package redhat-lsb-compat.x86_64 0:4.0-7.el6.centos will be 删除
--> 处理依赖关系 /lib/lsb/init-functions,它被软件包 tomcat6-6.0.24-80.el6.x86_64 需要
--> 处理依赖关系 /etc/cron.d,它被软件包 crontabs-1.10-33.el6.noarch 需要
--> 处理依赖关系 /etc/cron.d,它被软件包 sysstat-9.0.4-27.el6.x86_64 需要
--> 使用新的信息重新计算依赖关系
--> 执行事务检查
---> Package crontabs.noarch 0:1.10-33.el6 will be 删除
--> 处理依赖关系 crontabs,它被软件包 webalizer-2.21_02-3.3.el6.x86_64 需要
---> Package sysstat.x86_64 0:9.0.4-27.el6 will be 删除
---> Package tomcat6.x86_64 0:6.0.24-80.el6 will be 删除
--> 执行事务检查
---> Package webalizer.x86_64 0:2.21_02-3.3.el6 will be 删除
--> 完成依赖关系计算

依赖关系解决

==========================================================================================================================
 软件包                     架构         版本                        仓库                                            大小
==========================================================================================================================
正在删除:
 mysql-libs                 x86_64       5.1.73-3.el6_5              @anaconda-CentOS-201410241409.x86_64/6.6       4.0 M
为依赖而移除:
 MySQL-python               x86_64       1.2.3-0.3.c1.1.el6          @anaconda-CentOS-201410241409.x86_64/6.6       246 k
 cronie                     x86_64       1.4.4-12.el6                @anaconda-CentOS-201410241409.x86_64/6.6       174 k
 cronie-anacron             x86_64       1.4.4-12.el6                @anaconda-CentOS-201410241409.x86_64/6.6        43 k
 crontabs                   noarch       1.10-33.el6                 @anaconda-CentOS-201410241409.x86_64/6.6       2.4 k
 mysql-connector-odbc       x86_64       5.1.5r1144-7.el6            @anaconda-CentOS-201410241409.x86_64/6.6       345 k
 postfix                    x86_64       2:2.6.6-6.el6_5             @anaconda-CentOS-201410241409.x86_64/6.6       9.7 M
 redhat-lsb                 x86_64       4.0-7.el6.centos            @anaconda-CentOS-201410241409.x86_64/6.6       0.0
 redhat-lsb-compat          x86_64       4.0-7.el6.centos            @anaconda-CentOS-201410241409.x86_64/6.6       0.0
 redhat-lsb-core            x86_64       4.0-7.el6.centos            @anaconda-CentOS-201410241409.x86_64/6.6        22 k
 redhat-lsb-graphics        x86_64       4.0-7.el6.centos            @anaconda-CentOS-201410241409.x86_64/6.6       0.0
 redhat-lsb-printing        x86_64       4.0-7.el6.centos            @anaconda-CentOS-201410241409.x86_64/6.6       0.0
 sysstat                    x86_64       9.0.4-27.el6                @anaconda-CentOS-201410241409.x86_64/6.6       825 k
 tomcat6                    x86_64       6.0.24-80.el6               @anaconda-CentOS-201410241409.x86_64/6.6       188 k
 webalizer                  x86_64       2.21_02-3.3.el6             @anaconda-CentOS-201410241409.x86_64/6.6       324 k

事务概要
==========================================================================================================================
Remove       15 Package(s)

Installed size: 16 M
确定吗?[y/N]:y
下载软件包:
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
  正在删除   : redhat-lsb-compat-4.0-7.el6.centos.x86_64                                                             1/15
  正在删除   : redhat-lsb-4.0-7.el6.centos.x86_64                                                                    2/15
  正在删除   : redhat-lsb-graphics-4.0-7.el6.centos.x86_64                                                           3/15
  正在删除   : redhat-lsb-printing-4.0-7.el6.centos.x86_64                                                           4/15
  正在删除   : tomcat6-6.0.24-80.el6.x86_64                                                                          5/15
  正在删除   : redhat-lsb-core-4.0-7.el6.centos.x86_64                                                               6/15
  正在删除   : mysql-connector-odbc-5.1.5r1144-7.el6.x86_64                                                          7/15
/var/tmp/rpm-tmp.yTrcO8: line 1: lsb_release: command not found
  正在删除   : MySQL-python-1.2.3-0.3.c1.1.el6.x86_64                                                                8/15
  正在删除   : sysstat-9.0.4-27.el6.x86_64                                                                           9/15
  正在删除   : webalizer-2.21_02-3.3.el6.x86_64                                                                     10/15
  正在删除   : crontabs-1.10-33.el6.noarch                                                                          11/15
  正在删除   : cronie-anacron-1.4.4-12.el6.x86_64                                                                   12/15
  正在删除   : cronie-1.4.4-12.el6.x86_64                                                                           13/15
  正在删除   : 2:postfix-2.6.6-6.el6_5.x86_64                                                                       14/15
  正在删除   : mysql-libs-5.1.73-3.el6_5.x86_64                                                                     15/15
  Verifying  : redhat-lsb-printing-4.0-7.el6.centos.x86_64                                                           1/15
  Verifying  : cronie-anacron-1.4.4-12.el6.x86_64                                                                    2/15
  Verifying  : webalizer-2.21_02-3.3.el6.x86_64                                                                      3/15
  Verifying  : mysql-libs-5.1.73-3.el6_5.x86_64                                                                      4/15
  Verifying  : redhat-lsb-4.0-7.el6.centos.x86_64                                                                    5/15
  Verifying  : redhat-lsb-core-4.0-7.el6.centos.x86_64                                                               6/15
  Verifying  : sysstat-9.0.4-27.el6.x86_64                                                                           7/15
  Verifying  : MySQL-python-1.2.3-0.3.c1.1.el6.x86_64                                                                8/15
  Verifying  : crontabs-1.10-33.el6.noarch                                                                           9/15
  Verifying  : redhat-lsb-compat-4.0-7.el6.centos.x86_64                                                            10/15
  Verifying  : tomcat6-6.0.24-80.el6.x86_64                                                                         11/15
  Verifying  : mysql-connector-odbc-5.1.5r1144-7.el6.x86_64                                                         12/15
  Verifying  : cronie-1.4.4-12.el6.x86_64                                                                           13/15
  Verifying  : 2:postfix-2.6.6-6.el6_5.x86_64                                                                       14/15
  Verifying  : redhat-lsb-graphics-4.0-7.el6.centos.x86_64                                                          15/15 

删除:
  mysql-libs.x86_64 0:5.1.73-3.el6_5                                                                                      

作为依赖被删除:
  MySQL-python.x86_64 0:1.2.3-0.3.c1.1.el6                     cronie.x86_64 0:1.4.4-12.el6
  cronie-anacron.x86_64 0:1.4.4-12.el6                         crontabs.noarch 0:1.10-33.el6
  mysql-connector-odbc.x86_64 0:5.1.5r1144-7.el6               postfix.x86_64 2:2.6.6-6.el6_5
  redhat-lsb.x86_64 0:4.0-7.el6.centos                         redhat-lsb-compat.x86_64 0:4.0-7.el6.centos
  redhat-lsb-core.x86_64 0:4.0-7.el6.centos                    redhat-lsb-graphics.x86_64 0:4.0-7.el6.centos
  redhat-lsb-printing.x86_64 0:4.0-7.el6.centos                sysstat.x86_64 0:9.0.4-27.el6
  tomcat6.x86_64 0:6.0.24-80.el6                               webalizer.x86_64 0:2.21_02-3.3.el6                         

完毕!
[[email protected] home]# rpm -qa | grep mysql
[[email protected] home]#
安装依赖
[[email protected] data]# yum -y install wget gcc gcc-c++ ncurses-devel cmake make perl

[[email protected] data]# rpm -qa | grep wget
wget-1.12-5.el6_6.1.x86_64
[[email protected] data]# rpm -qa | grep gcc
gcc-4.4.7-16.el6.x86_64
libgcc-4.4.7-16.el6.x86_64
gcc-c++-4.4.7-16.el6.x86_64

创建mysql用户组
[[email protected] data]# groupadd mysql
创建Mysql用户
[[email protected] data]# useradd -r -g mysql mysql

看下是否成功
[[email protected] data]# id mysql
uid=501(mysql) gid=501(mysql) 组=501(mysql)

创建mysql安装目录和数据库文件存放目录
[[email protected] data]# mkdir -p /usr/local/mysql
[[email protected] data]# mkdir -p /usr/local/mysql/data
切换到mysql源码的目录,解出源码包
[[email protected] sh]# cd src/
[[email protected] src]# ll
总用量 214948
-rw-r--r--. 1 root root   8886737 4月  26 02:01 apache-tomcat-7.0.67.tar.gz
-rw-r--r--. 1 root root  10571419 4月  26 02:01 apache-tomcat-8.0.15-windows-x64.zip
-rw-r--r--. 1 root root   5768373 4月  26 02:00 cmake-2.8.10.2.tar.gz
-rw-r--r--. 1 root root 160901914 4月  26 02:01 jdk-8u31-linux-x64.tar.gz
-rw-r--r--. 1 root root    413811 4月  26 02:00 libevent-1.2.tar.gz
-rw-r--r--. 1 root root  32182980 4月  26 02:01 mysql-5.6.28.tar.gz
-rw-r--r--. 1 root root   1366160 4月  26 02:01 redis-3.0.5.tar.gz
[[email protected] src]# tar -zxvf mysql-5.6.28.tar.gz
[[email protected] src]# cd mysql-5.6.28
[[email protected] mysql-5.6.28]# ll
总用量 732
drwxr-xr-x.  2 7161 wheel   4096 11月 16 18:45 BUILD
-rw-r--r--.  1 7161 wheel    142 11月 16 17:38 BUILD-CMAKE
drwxr-xr-x.  2 7161 wheel   4096 11月 16 18:45 client
drwxr-xr-x.  4 7161 wheel   4096 11月 16 18:45 cmake
-rw-r--r--.  1 7161 wheel  21711 11月 16 17:38 CMakeLists.txt
drwxr-xr-x.  3 7161 wheel   4096 11月 16 18:45 cmd-line-utils
-rw-r--r--.  1 7161 wheel  19628 11月 16 17:38 config.h.cmake
-rw-r--r--.  1 7161 wheel  40292 11月 16 17:38 configure.cmake
-rw-r--r--.  1 7161 wheel  17987 11月 16 17:38 COPYING
drwxr-xr-x.  2 7161 wheel   4096 11月 16 18:45 dbug
drwxr-xr-x.  2 7161 wheel   4096 11月 16 18:45 Docs
-rw-r--r--.  1 7161 wheel  65958 11月 16 17:38 Doxyfile-perfschema
drwxr-xr-x.  3 7161 wheel   4096 11月 16 18:45 extra
drwxr-xr-x.  4 7161 wheel   4096 11月 16 18:45 include
-rw-r--r--.  1 7161 wheel 409774 11月 16 18:45 INSTALL-SOURCE
-rw-r--r--.  1 7161 wheel    247 11月 16 17:38 INSTALL-WIN-SOURCE
drwxr-xr-x.  7 7161 wheel   4096 11月 16 18:45 libevent
drwxr-xr-x.  3 7161 wheel   4096 11月 16 18:45 libmysql
drwxr-xr-x.  3 7161 wheel   4096 11月 16 18:45 libmysqld
drwxr-xr-x.  2 7161 wheel   4096 11月 16 18:45 libservices
drwxr-xr-x.  2 7161 wheel   4096 11月 16 18:45 man
drwxr-xr-x. 10 7161 wheel   4096 11月 16 18:45 mysql-test
drwxr-xr-x.  2 7161 wheel   4096 11月 16 18:45 mysys
drwxr-xr-x.  2 7161 wheel   4096 11月 16 18:45 mysys_ssl
drwxr-xr-x. 15 7161 wheel   4096 11月 16 18:45 packaging
drwxr-xr-x.  9 7161 wheel   4096 11月 16 18:45 plugin
-rw-r--r--.  1 7161 wheel   2496 11月 16 17:38 README
drwxr-xr-x.  2 7161 wheel   4096 11月 16 18:45 regex
drwxr-xr-x.  2 7161 wheel   4096 11月 16 18:45 scripts
drwxr-xr-x.  4 7161 wheel  20480 11月 16 18:45 sql
drwxr-xr-x.  5 7161 wheel   4096 11月 16 18:45 sql-bench
drwxr-xr-x.  2 7161 wheel   4096 11月 16 18:45 sql-common
drwxr-xr-x. 13 7161 wheel   4096 11月 16 18:45 storage
drwxr-xr-x.  2 7161 wheel   4096 11月 16 18:45 strings
drwxr-xr-x.  5 7161 wheel   4096 11月 16 18:45 support-files
drwxr-xr-x.  2 7161 wheel   4096 11月 16 18:45 tests
drwxr-xr-x.  5 7161 wheel   4096 11月 16 18:45 unittest
-rw-r--r--.  1 7161 wheel     88 11月 16 17:38 VERSION
drwxr-xr-x.  3 7161 wheel   4096 11月 16 18:45 vio
drwxr-xr-x.  2 7161 wheel   4096 11月 16 18:45 win
drwxr-xr-x.  2 7161 wheel   4096 11月 16 18:45 zlib

这一步应该cmake配置,之前先看看cmake选项,有点长,不想看可略到11步

[[email protected] mysql-5.6.28]# 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=/usr/local/mysql/data -DMYSQL_TCP_PORT=3306 -DMYSQL_USER=mysql -DENABLE_DOWNLOADS=1
Warning: Bison executable not found in PATH
-- Library mysqlserver depends on OSLIBS -lpthread;m;rt;crypt;dl
-- CMAKE_BUILD_TYPE: RelWithDebInfo
-- COMPILE_DEFINITIONS: HAVE_CONFIG_H
-- CMAKE_C_FLAGS:  -Wall -Wextra -Wformat-security -Wvla -Wwrite-strings -Wdeclaration-after-statement
-- CMAKE_CXX_FLAGS:  -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter
-- CMAKE_C_FLAGS_RELWITHDEBINFO: -O3 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O3 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    MYSQL_USER

-- Build files have been written to: /home/sh/src/mysql-5.6.28
如果出现以上报错信息的话就
[[email protected] mysql-5.6.28]# yum install bison

然后再
[[email protected] mysql-5.6.28]# 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=/usr/local/mysql/data -DMYSQL_TCP_PORT=3306 -DMYSQL_USER=mysql -DENABLE_DOWNLOADS=1

-- Running cmake version 2.8.12.2
-- Could NOT find Git (missing:  GIT_EXECUTABLE)
-- MySQL 5.6.28
-- Packaging as: mysql-5.6.28-Linux-x86_64
-- HAVE_VISIBILITY_HIDDEN
-- HAVE_VISIBILITY_HIDDEN
-- HAVE_VISIBILITY_HIDDEN
-- Using cmake version 2.8.12.2
-- Not building NDB
-- Library mysqlclient depends on OSLIBS -lpthread;m;rt;dl
-- Download failed, error: 6;"Couldn't resolve host name"
-- To enable google test, please download http://googlemock.googlecode.com/files/gmock-1.6.0.zip to the directory /home/sh/src/mysql-5.6.28/source_downloads
-- If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://example.com:80
-- Library mysqlserver depends on OSLIBS -lpthread;m;rt;crypt;dl
-- CMAKE_BUILD_TYPE: RelWithDebInfo
-- COMPILE_DEFINITIONS: HAVE_CONFIG_H
-- CMAKE_C_FLAGS:  -Wall -Wextra -Wformat-security -Wvla -Wwrite-strings -Wdeclaration-after-statement
-- CMAKE_CXX_FLAGS:  -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter
-- CMAKE_C_FLAGS_RELWITHDEBINFO: -O3 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O3 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sh/src/mysql-5.6.28

如果报以上错误的话Could NOT find Git (missing:  GIT_EXECUTABLE)就安装git
[[email protected] mysql-5.6.28]# yum install git

-- Running cmake version 2.8.12.2
-- Found Git: /usr/bin/git (found version "1.7.1")
-- MySQL 5.6.28
-- Packaging as: mysql-5.6.28-Linux-x86_64
-- HAVE_VISIBILITY_HIDDEN
-- HAVE_VISIBILITY_HIDDEN
-- HAVE_VISIBILITY_HIDDEN
-- Using cmake version 2.8.12.2
-- Not building NDB
-- Library mysqlclient depends on OSLIBS -lpthread;m;rt;dl
-- Download failed, error: 7;"Couldn't connect to server"
-- To enable google test, please download http://googlemock.googlecode.com/files/gmock-1.6.0.zip to the directory /home/sh/src/mysql-5.6.28/source_downloads
-- If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://example.com:80
-- Library mysqlserver depends on OSLIBS -lpthread;m;rt;crypt;dl
-- CMAKE_BUILD_TYPE: RelWithDebInfo
-- COMPILE_DEFINITIONS: HAVE_CONFIG_H
-- CMAKE_C_FLAGS:  -Wall -Wextra -Wformat-security -Wvla -Wwrite-strings -Wdeclaration-after-statement
-- CMAKE_CXX_FLAGS:  -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter
-- CMAKE_C_FLAGS_RELWITHDEBINFO: -O3 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O3 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sh/src/mysql-5.6.28

[[email protected] mysql-5.6.28]# 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=/usr/local/mysql/data -DMYSQL_TCP_PORT=3306 -DMYSQL_USER=mysql -DENABLE_DOWNLOADS=1

编译代码,这个时间比较长
[[email protected] mysql-5.6.28]# make
安装
[[email protected] mysql-5.6.28]# make install

查看下结果
[[email protected] mysql-5.6.28]# ll /usr/local/mysql/
总用量 172
drwxr-xr-x.  2 root root   4096 4月  26 02:54 bin
-rw-r--r--.  1 root root  17987 11月 16 17:38 COPYING
drwxr-xr-x.  3 root root   4096 4月  26 02:54 data
drwxr-xr-x.  2 root root   4096 4月  26 02:54 docs
drwxr-xr-x.  3 root root   4096 4月  26 02:54 include
-rw-r--r--.  1 root root 105684 11月 16 18:45 INSTALL-BINARY
drwxr-xr-x.  3 root root   4096 4月  26 02:54 lib
drwxr-xr-x.  4 root root   4096 4月  26 02:54 man
drwxr-xr-x. 10 root root   4096 4月  26 02:54 mysql-test
-rw-r--r--.  1 root root   2496 11月 16 17:38 README
drwxr-xr-x.  2 root root   4096 4月  26 02:54 scripts
drwxr-xr-x. 28 root root   4096 4月  26 02:54 share
drwxr-xr-x.  4 root root   4096 4月  26 02:54 sql-bench
drwxr-xr-x.  2 root root   4096 4月  26 02:54 support-files
[[email protected] mysql-5.6.28]# ll /usr/local/mysql/data/
总用量 4
drwxr-xr-x. 2 root root 4096 4月  26 02:54 test

清楚临时文件
[[email protected] mysql-5.6.28]# make clean

修改目录属主数组
[[email protected] mysql-5.6.28]# chown -R mysql:mysql /usr/local/mysql/data
[[email protected] mysql-5.6.28]# chown -R mysql:mysql /usr/local/mysql

创建MySQL Server系统表
[[email protected] mysql-5.6.28]# cd /usr/local/mysql/
[[email protected] mysql]# scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data
Installing MySQL system tables...2016-04-26 02:57:25 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-26 02:57:25 0 [Note] ./bin/mysqld (mysqld 5.6.28) starting as process 26284 ...
2016-04-26 02:57:25 26284 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-04-26 02:57:25 26284 [Note] InnoDB: The InnoDB memory heap is disabled
2016-04-26 02:57:25 26284 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-04-26 02:57:25 26284 [Note] InnoDB: Memory barrier is not used
2016-04-26 02:57:25 26284 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-04-26 02:57:25 26284 [Note] InnoDB: Using CPU crc32 instructions
2016-04-26 02:57:25 26284 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-04-26 02:57:25 26284 [Note] InnoDB: Completed initialization of buffer pool
2016-04-26 02:57:25 26284 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2016-04-26 02:57:25 26284 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2016-04-26 02:57:25 26284 [Note] InnoDB: Database physically writes the file full: wait...
2016-04-26 02:57:25 26284 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2016-04-26 02:57:25 26284 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2016-04-26 02:57:25 26284 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2016-04-26 02:57:25 26284 [Warning] InnoDB: New log files created, LSN=45781
2016-04-26 02:57:25 26284 [Note] InnoDB: Doublewrite buffer not found: creating new
2016-04-26 02:57:25 26284 [Note] InnoDB: Doublewrite buffer created
2016-04-26 02:57:25 26284 [Note] InnoDB: 128 rollback segment(s) are active.
2016-04-26 02:57:25 26284 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-04-26 02:57:25 26284 [Note] InnoDB: Foreign key constraint system tables created
2016-04-26 02:57:25 26284 [Note] InnoDB: Creating tablespace and datafile system tables.
2016-04-26 02:57:25 26284 [Note] InnoDB: Tablespace and datafile system tables created.
2016-04-26 02:57:25 26284 [Note] InnoDB: Waiting for purge to start
2016-04-26 02:57:25 26284 [Note] InnoDB: 5.6.28 started; log sequence number 0
2016-04-26 02:57:26 26284 [Note] Binlog end
2016-04-26 02:57:26 26284 [Note] InnoDB: FTS optimize thread exiting.
2016-04-26 02:57:26 26284 [Note] InnoDB: Starting shutdown...
2016-04-26 02:57:27 26284 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK

Filling help tables...2016-04-26 02:57:27 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-26 02:57:27 0 [Note] ./bin/mysqld (mysqld 5.6.28) starting as process 26307 ...
2016-04-26 02:57:27 26307 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-04-26 02:57:27 26307 [Note] InnoDB: The InnoDB memory heap is disabled
2016-04-26 02:57:27 26307 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-04-26 02:57:27 26307 [Note] InnoDB: Memory barrier is not used
2016-04-26 02:57:27 26307 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-04-26 02:57:27 26307 [Note] InnoDB: Using CPU crc32 instructions
2016-04-26 02:57:27 26307 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-04-26 02:57:27 26307 [Note] InnoDB: Completed initialization of buffer pool
2016-04-26 02:57:27 26307 [Note] InnoDB: Highest supported file format is Barracuda.
2016-04-26 02:57:27 26307 [Note] InnoDB: 128 rollback segment(s) are active.
2016-04-26 02:57:27 26307 [Note] InnoDB: Waiting for purge to start
2016-04-26 02:57:27 26307 [Note] InnoDB: 5.6.28 started; log sequence number 1625977
2016-04-26 02:57:27 26307 [Note] Binlog end
2016-04-26 02:57:27 26307 [Note] InnoDB: FTS optimize thread exiting.
2016-04-26 02:57:27 26307 [Note] InnoDB: Starting shutdown...
2016-04-26 02:57:28 26307 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  ./bin/mysqladmin -u root password 'new-password'
  ./bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:

  ./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as ./my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

[[email protected] mysql]# scripts/mysql_install_db --help

把初始化生成的 /usr/local/mysql/my.cnf 配置文件的属主数组更改为mysql:
drwxr-xr-x.  2 mysql mysql   4096 4月  26 02:54 support-files
[[email protected] mysql]# chown -R mysql:mysql /usr/local/mysql
配置启动脚本
[[email protected] mysql]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
启动MySQL
[[email protected] mysql]# /etc/init.d/mysql status
 ERROR! MySQL is not running
[[email protected] mysql]# /etc/init.d/mysql start
Starting MySQL. SUCCESS!
[[email protected] mysql]# ps -aux |grep mysql
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
root     26388  0.1  0.0 106224  1488 pts/0    S    03:00   0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/localhost.localdomain.pid
mysql    26491  6.0  5.6 1010016 452156 pts/0  Sl   03:00   0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/localhost.localdomain.err --pid-file=/usr/local/mysql/data/localhost.localdomain.pid
root     26516  0.0  0.0 103256   844 pts/0    S+   03:01   0:00 grep mysql

配置环境变量
[[email protected] mysql]# vi /etc/profile

在后面加上
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib
export PATH
变量生效
[[email protected] mysql]# source /etc/profile

设置数据库密码
[[email protected] mysql]# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.28 Source distribution

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;//切换到Mysql表
Database changed
mysql> desc user;//显示字段
+------------------------+-----------------------------------+------+-----+-----------------------+-------+
| Field                  | Type                              | Null | Key | Default               | Extra |
+------------------------+-----------------------------------+------+-----+-----------------------+-------+
| Host                   | char(60)                          | NO   | PRI |                       |       |
| User                   | char(16)                          | NO   | PRI |                       |       |
| Password               | char(41)                          | NO   |     |                       |       |
| Select_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Insert_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Update_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Delete_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Create_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Drop_priv              | enum('N','Y')                     | NO   |     | N                     |       |
| Reload_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Shutdown_priv          | enum('N','Y')                     | NO   |     | N                     |       |
| Process_priv           | enum('N','Y')                     | NO   |     | N                     |       |
| File_priv              | enum('N','Y')                     | NO   |     | N                     |       |
| Grant_priv             | enum('N','Y')                     | NO   |     | N                     |       |
| References_priv        | enum('N','Y')                     | NO   |     | N                     |       |
| Index_priv             | enum('N','Y')                     | NO   |     | N                     |       |
| Alter_priv             | enum('N','Y')                     | NO   |     | N                     |       |
| Show_db_priv           | enum('N','Y')                     | NO   |     | N                     |       |
| Super_priv             | enum('N','Y')                     | NO   |     | N                     |       |
| Create_tmp_table_priv  | enum('N','Y')                     | NO   |     | N                     |       |
| Lock_tables_priv       | enum('N','Y')                     | NO   |     | N                     |       |
| Execute_priv           | enum('N','Y')                     | NO   |     | N                     |       |
| Repl_slave_priv        | enum('N','Y')                     | NO   |     | N                     |       |
| Repl_client_priv       | enum('N','Y')                     | NO   |     | N                     |       |
| Create_view_priv       | enum('N','Y')                     | NO   |     | N                     |       |
| Show_view_priv         | enum('N','Y')                     | NO   |     | N                     |       |
| Create_routine_priv    | enum('N','Y')                     | NO   |     | N                     |       |
| Alter_routine_priv     | enum('N','Y')                     | NO   |     | N                     |       |
| Create_user_priv       | enum('N','Y')                     | NO   |     | N                     |       |
| Event_priv             | enum('N','Y')                     | NO   |     | N                     |       |
| Trigger_priv           | enum('N','Y')                     | NO   |     | N                     |       |
| Create_tablespace_priv | enum('N','Y')                     | NO   |     | N                     |       |
| ssl_type               | enum('','ANY','X509','SPECIFIED') | NO   |     |                       |       |
| ssl_cipher             | blob                              | NO   |     | NULL                  |       |
| x509_issuer            | blob                              | NO   |     | NULL                  |       |
| x509_subject           | blob                              | NO   |     | NULL                  |       |
| max_questions          | int(11) unsigned                  | NO   |     | 0                     |       |
| max_updates            | int(11) unsigned                  | NO   |     | 0                     |       |
| max_connections        | int(11) unsigned                  | NO   |     | 0                     |       |
| max_user_connections   | int(11) unsigned                  | NO   |     | 0                     |       |
| plugin                 | char(64)                          | YES  |     | mysql_native_password |       |
| authentication_string  | text                              | YES  |     | NULL                  |       |
| password_expired       | enum('N','Y')                     | NO   |     | N                     |       |
+------------------------+-----------------------------------+------+-----+-----------------------+-------+
43 rows in set (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO [email protected]"%" IDENTIFIED BY "root";//为root添加远程连接的能力,据需谨慎操作。
Query OK, 0 rows affected (0.00 sec)

mysql> update user set password = password('1111111') where User='root';//更新root密码
Query OK, 5 rows affected (0.00 sec)
Rows matched: 5  Changed: 5  Warnings: 0

mysql> select host,user,password  from user where User='root';

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> \q
Bye

根据需要设置开机自动启动服务
[[email protected] mysql]# chkconfig mysql on

在此就设置结束了
使用navicat登录mysql就可以了

sudo /etc/init.d/mysql restart

时间: 2024-10-07 18:52:17

mysql-5.6.28 整个安装过程详细教程,详解的相关文章

webpack安装配置使用教程详解

webpack安装配置使用教程详解 www.111cn.net 更新:2015-09-01 编辑:swteen 来源:转载 本文章来为各位详细的介绍一下关于webpack安装配置使用教程吧,这篇文章对于不喜欢使用 jspm测试的朋友可以参考一下. webpack 入门 目录 1 安装 webpack2 初始化项目3 webpack 配置4 自动刷新5 第三方库6 模块化7 打包.构建8 webpack 模板我最近大量使用的是 jspm,但因为用它搭建的前端开发环境中,写测试代码非常困难,而项目又

Android模拟器Genymotion安装及使用教程详解

尊重版权,未经授权不得转载 本文出自:http://blog.csdn.net/fengyuzhengfan/article/details/53366252 一直以来都有不少朋友问我关于Android模拟器的事情,比如:那个Android模拟比较快,如何安装使用之类.今天我整理出来这篇教程,供我的朋友以及各位小伙伴们查阅借鉴. Android的模拟器很多,但最原汁原味的还数Android SDK中的模拟器,毕竟是Google的亲儿子.之前Android SDK中的模拟器运行速度一直是大家吐槽的

mysql在win系统dos 安装版配置步骤详解

1.准备工作 下载mysql的最新免安装版本mysql-noinstall-5.1.53-win32.zip,解压缩到相关目录,如:d:\ mysql-noinstall-5.1.53-win32.这个就是mysql的根目录了. --------------------------------------------------------------------------------------------- 2.配置 在根目录下有几个文件如下: my-small.ini (这是针对一个小内

mongodb 3.2.5安装过程详细记录

2016-10-19    mongodb 3.2.5安装 1 准备安装介质 安装介质下载: mongodb的安装方式,我通常使用二进制包的方式,内网不能配置连接外网的yum源: 官方建议的mongodb下载地址为:   Downloads.mongodb.org 但实际上,这个地址,很难找到下载表,正常下载,通常可以用下面的下载地址选择下载: 我这里下载的是: 3.2.5 版本对应的 mongodb-linux-x86_64-rhel62-3.2.5-20-g07e21d8.tgz 如果将整个

mysql for linux 数据库的安装过程

mysql for linux 数据库的安装过程 l  安装版本:mysql-advanced-5.6.12-linux-glibc2.5-x86_64.tar.gz ,此版本是绿色版本,只需要将其解压到相关目录即可. PS:此安装方法为不针对特定平台的通用安装方法,使用的二进制文件是后缀为.tar.gz的压缩文件 PS:Mysql下载地址:http://pan.baidu.com/s/1eQJhoLO 1.创建mysql用户/账号 [[email protected] ~]#  groupad

QTP11.00安装+破解详细教程

一.      安装过程 首先双击setup.exe文件,选择“QuickTest Professional安装程序” 此时会查看你机子上面是否有QTP需要,但是机子上没有的组件, 跟着先安装这两个组件 首先安装“Microsoft vlisual C++ 2005 SP1运行时组件”可以尝试以下方法: 可以在安装包的子目录“quicktest-professional-11(1)\RunResultsViewer\CHS\prerequisites\vc2005_sp1_redist” 找到“

ubuntu安装scala详细教程

ubuntu14 安装scala详细教程 1.下载scala压缩包 http://www.scala-lang.org/download/ 2.建立目录,解压文件到所建立目录 $ sudo mkdir /opt/scala $ sudo tar zxvf scala-2.11.2.tgz -C /opt/scala 3.添加环境变量 /*编辑配置文件bashrc (该配置文件只对当前用户有效)*/$ vim ~/.bashrc/*在文件的结尾添加如下:×/export PATH=/opt/sca

MySql 安装及初级使用详解

1. sudo apt-get install mysql-server, input administrator password , '123' 2. enter mysql promot in command line, 'mysql -u root -p', input password 3. create database "CREATE DATABASE xoops:" 4. 允许root远程登陆: 从所有主机:grant all privileges on *.* to

VM中安装centos详细教程

VM中安装centos详细教程 图片讲解: 原文地址:https://www.cnblogs.com/kingle-study/p/9269718.html