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. scanf在竞赛中的技巧总结ing

    前言 当输入流是一个字符串,我们需要在其中提取我们所需要的数值时,我们可以在读入阶段就完成数据的筛选工作. 使用方法 scanf("%ns", str); 表示读取长度为n的字符串 ...

  2. HttpClient使用示例

    1)使用HttpClient发送GET请求 public class MainActivity extends Activity implements OnClickListener { privat ...

  3. Django 组件-cookie与session

    Cookie概述 什么叫Cookie Cookie翻译成中文是小甜点,小饼干的意思.在HTTP中它表示服务器送给客户端浏览器的小甜点.其实Cookie是key-value结构,类似于一个python中 ...

  4. java代码-----实现有键盘获得的字符串存储在文件中,并从文件中读取后显示在屏幕上

    总结: 没体会到 package com.a.b; import java.io.*; public class tsetOut { public static void main(String[] ...

  5. ActiveMQ入门之四--ActiveMQ持久化方式

    消息持久性对于可靠消息传递来说应该是一种比较好的方法,有了消息持久化,即使发送者和接受者不是同时在线或者消息中心在发送者发送消息后宕机了,在消息中心重新启动后仍然可以将消息发送出去,如果把这种持久化和 ...

  6. 一个jquery-ajax post例子ajax 登陆

    index.html文件 <html> <head> <meta http-equiv="Content-Type" content="te ...

  7. 015:索引、B+树

    一. 索引 1. 索引的定义 索引是一种单独的.物理的对数据库表中一列或多列的值进行排序的一种存储结构,它是某个表中一列或若干列值的集合和相应的指向表中物理标识这些值的数据页的逻辑指针清单.索引的作用 ...

  8. jquery.easyui.tabs 中的首个tabs被最后tabs覆盖的问题解决方法

    这是由于tabs对href重载的的问题导致,因此我们需要将href更改为其它自定义的属性即可避免此问题的发生. 解决方法如下: 第一步页面端: 循环体开始 <li> <div> ...

  9. mac环境下IDEA无法下载plugin或者自动下载Library

    卧槽,原谅我这么晚还在写blog,明天早上还要上班. 问题,idea 新建springmvc无法自动下载lib,报这个: you have JVM property "https.proxy ...

  10. HTML5的离线存储有几种方式?

    localStorage长期存储数据,浏览器关闭后数据不丢失: sessionStorage数据在浏览器关闭后自动删除.