1、下载软件

[root@localhost src]# wget -q http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz

2、解压、移动

[root@localhost /]# yum -y install gcc gcc-c++ zlib-devel libtool ncurses-devel libxml2-devel cmake
[root@localhost /]# useradd -s /sbin/nologin -M mysql
[root@localhost /]# mkdir -p /usr/local/mysql
[root@localhost /]# mkdir -p /usr/local/mysql/data/mysql
[root@localhost /]# cd /usr/local/src/
[root@localhost src]# pwd
/usr/local/src
[root@localhost src]# ls
mysql-5.6.-linux-glibc2.-x86_64.tar.gz
[root@localhost src]# tar xf mysql-5.6.-linux-glibc2.-x86_64.tar.gz
[root@localhost src]# cd mysql-5.6.

3、编译、安装

[root@localhost mysql-5.6.]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data/mysql -DWITH_INNOBASE_STORAGE_ENGINE= -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
[root@localhost mysql-5.6.]# make
[root@localhost mysql-5.6.]# make install
[root@localhost mysql-5.6.]# echo $? [root@localhost mysql-5.6.]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
[root@localhost mysql-5.6.]# chmod +x /etc/init.d/mysqld
[root@localhost mysql-5.6.]# chown -R mysql:mysql /usr/local/mysql/data/mysql
[root@localhost mysql-5.6.]# chown -R mysql:mysql /usr/local/mysql/

4、初始化数据库

[root@localhost mysql-5.6.]# cd /usr/local/mysql/scripts/
[root@localhost scripts]# pwd
/usr/local/mysql/scripts
[root@localhost scripts]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/mysql
[root@localhost scripts]# cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
cp: overwrite `/etc/my.cnf'? y [root@liveneo- scripts]# vim /etc/my.cnf
# port = .....
# server_id = .....
# socket = ..... datadir = /usr/local/mysql/data/mysql
port =
server_id =
socket = /usr/local/mysql/mysql.sock # Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
lower_case_table_names =
wait_timeout=
log_bin_trust_function_creators=
max_connections=

5、配置环境变量

[root@localhost scripts]# vim /etc/profile
export PATH=$PATH:/usr/local/mysql/bin
[root@localhost scripts]# source /etc/profile
[root@localhost scripts]# /etc/init.d/mysqld start
Starting MySQL. SUCCESS!
[root@localhost scripts]# netstat -nlpt | grep mysql
tcp ::: :::* LISTEN /mysqld
[root@liveneo- mysql]# ls
bin COPYING data docs include lib man my.cnf mysql.sock mysql-test README scripts share sql-bench support-files
[root@localhost scripts]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.6. Source distribution Copyright (c) , , 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
rows in set (0.00 sec) mysql> exit
Bye

6、给root设置密码

[root@localhost scripts]# mysqladmin -uroot password ""
Warning: Using a password on the command line interface can be insecure.
[root@localhost scripts]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.6. Source distribution Copyright (c) , , 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>
mysql>
mysql> exit
Bye

7、创建远程连接用户并授权

[root@localhost scripts]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.6. Source distribution Copyright (c) , , 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> CREATE USER 'user'@'%' IDENTIFIED BY '';
Query OK, rows affected (0.00 sec) mysql> GRANT ALL ON *.* TO 'user'@'%';
Query OK, rows affected (0.00 sec) mysql>

MySQL5.6.35部署的更多相关文章

  1. [Deepin 15] 编译安装 MySQL-5.6.35

    在 Ubuntu 下,先前一直是 二进制包解压安装,详情参考: http://www.cnblogs.com/52php/p/5680906.html 现改为 源码编译安装: #!/bin/bash ...

  2. Centos编译安装 LAMP (apache-2.4.7 + mysql-5.5.35 + php 5.5.8)+ Redis

    转载地址:http://www.cnblogs.com/whoamme/p/3530056.html 软件源代码包存放位置:/usr/local/src 源码包编译安装位置:/usr/local/软件 ...

  3. 64位CentOs7源码安装mysql-5.6.35过程分享

    首先安装依赖包,避免在安装过程中出现问题 [root@bogon liuzhen]# yum -y install gcc gcc-c++[root@bogon liuzhen]# yum -y in ...

  4. CentOS6.5源码安装MySQL5.6.35

    CentOS6.5源码安装MySQL5.6.35 一.卸载旧版本 1.使用下面的命令检查是否安装有mysql [root@localhost tools]# rpm -qa|grep -i mysql ...

  5. CentOS6.5下RPM包安装MySQL5.6.35

    基本环境:VMware10.0+CentOS6.5+MySQL5.6.35 .查看操作系统相关 shell> cat /etc/issue shell> uname -a .创建需要下载r ...

  6. CentOS6.5下源码安装MySQL5.6.35

    接上一篇文章使用RPM包安装MySQL,确实很方便.但是安装后却不知道各文件保存在哪个文件夹下!尝试使用源码安装~本文主要参考:CentOS 6.4下编译安装MySQL 5.6.14一.卸载旧版本 . ...

  7. 在CentOs7源码安装mysql-5.6.35单实例数据库

    首先安装依赖包,避免在安装过程中出现问题 [root@bogon liuzhen]# yum -y install gcc gcc-c++[root@bogon liuzhen]# yum -y in ...

  8. 一分钟完成MySQL5.7安装部署

    原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://suifu.blog.51cto.com/9167728/1855415 Part ...

  9. centos6.8下LNMP (nginx1.8.0+php5.6.10+mysql5.6.12) - 部署手册

    在平时运维工作中,经常需要用到LNMP应用框架.以下对LNMP环境部署记录下: 1)前期准备:为了安装顺利,建议先使用yum安装依赖库[root@opd ~]#yum install -y make ...

随机推荐

  1. 互联网的keyvalue处理

    今天在和许伟讨论系统配置页面得时候,许伟提到了“打通页面”的概念,当时我没太明白,后来才知道是指类似于cloudera里面的配置页面那种,不是列表页,而是展示+编辑在一个页面.刚才想了一下,其实对于这 ...

  2. mysql工作流程

    1.connector sql交互语言,php,java等 2.系统管理和控制工具 3.连接池 管理缓冲用户连接,线程处理等需要缓存的需求 4.Sql接口接受sql命令,返回查询结果 5.解释器 sq ...

  3. VBA7种遍历方法

    Sub 在选定文档最后加入一句话() '遍历文件 Dim MyDialog As FileDialog On Error Resume NextApplication.ScreenUpdating = ...

  4. thinkphp如果表名有下划线需要用Model

    模型命名规范 ThinkPHP 对数据库的表名和模型类的命名遵循一定的规范.首先数据库的表名和字段全部采用小写形式,模型类的命名规则是除去表前缀的数据表名称,并且首字母大写,然后加上模型类的后缀定义. ...

  5. 第七章 伪分布式安装hive,sqoop

    第一部分:先讲这么去安装hive.先去hive官网下载,我这里以hive-0.12.0为例子. 前面第二章讲了安装hadoop,hbase实例,我们继续讲这么安装hive,先说下hive配置文件 一, ...

  6. java后台读取配置文件中key与value -----demo2

    /** * * @Title: getValue * @Description: TODO * @param key * @return import java.util.Properties; * ...

  7. mysql导出文本文件,加分隔符

    从mysql导出,再导入到oracle #!/bin/sh cd /u03/tools/machine_info rm -f data/machine_info.txt mysql -u用户名 -p密 ...

  8. html中的一些常用的样式标签

    html中的一些常用的样式标签 <p>这里是文本,<mark>高亮</mark></p> <strong>加粗,加重语气</stron ...

  9. Ubuntu13.10:密码忘记了怎么办?

    重启ubuntu系统,开机时长按shift按键进入GRUB菜单,选择第二个高级模式. 新版的UBUNTU系统居然启用了GRUNB2.0的内核!虽然传说相当的牛X,但是用起来感觉就是非常看不清楚字体,要 ...

  10. 10_java之继承和抽象类

    01继承的概述 *A:继承的概念 *a:继承描述的是事物之间的所属关系,通过继承可以使多种事物之间形成一种关系体系 *b:在Java中,类的继承是指在一个现有类的基础上去构建一个新的类, 构建出来的新 ...