一.下载对应的软件版本

下载地址:http://mirrors.sohu.com/mysql/MySQL-5.6/

备用地址:http://ftp.ntu.edu.tw/pub/MySQL/Downloads/

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

二、解压、配置用户和权限

[root@localhost ~]# mkdir -pv  /Data/apps
[root@localhost ~]# tar xf mysql-5.6.-linux-glibc2.-x86_64.tar.gz -C /Data/apps/
[root@localhost ~]# cd /Data/apps/
[root@localhost apps]# mv mysql-5.6.-linux-glibc2.-x86_64/ mysql-5.6.
[root@localhost ~]# useradd -s /sbin/nologin -M mysql
[root@localhost ~]# chown -R mysql.mysql /Data/apps/mysql-5.6.
[root@localhost ~]# cd /Data/apps/mysql-5.6.

三、初始化数据库

[root@localhost mysql-5.6.]#  cp support-files/my-default.cnf /etc/my.cnf
[root@localhost mysql-5.6.]# ./scripts/mysql_install_db --basedir=/Data/apps/mysql-5.6./ --datadir=/Data/apps/mysql-5.6./data/ --user=mysql
[root@localhost mysql-5.6.]# cp support-files/mysql.server /etc/init.d/mysqld
[root@localhost mysql-5.6.]# chmod +x /etc/init.d/mysqld
[root@localhost mysql-5.6.]# sed -i 's#/usr/local/mysql#/Data/apps/mysql-5.6.36#g' /etc/init.d/mysqld #主要最后都没有'/'
[root@localhost mysql-5.6.]# service mysqld start
Starting MySQL.Logging to '/Data/apps/mysql-5.6.36/data/localhost.localdomain.err'.
.. [确定]
[root@localhost mysql-5.6.]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0.0.0.0: 0.0.0.0:* LISTEN /sshd
tcp ::: :::* LISTEN /sshd
tcp :::

四、配置MySQL环境变量

[root@localhost mysql-5.6.36]# echo "export PATH=/Data/apps/mysql-5.6.36/bin:$PATH" > /etc/profile.d/mysql.sh
[root@localhost mysql-5.6.36]# . /etc/profile.d/mysql.sh

五、测试登录

root@localhost mysql-5.6.]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.6. MySQL Community Server (GPL) 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> select version();
+-----------+
| version() |
+-----------+
| 5.6. |
+-----------+
row in set (0.05 sec) mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
rows in set (0.15 sec)

六、配置安全策略(建议)

[root@localhost mysql-5.6.]# mysql_secure_installation 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here. Enter current password for root (enter for none):
.................................
..............................略

快速部署MySQL数据库的更多相关文章

  1. 2.快速部署MySQL主从复制

      1.快速部署MySQL主从复制 [root@mysql ~]# mysql -uroot -p123456 -S /data/3307/mysql.sock -e "show slave ...

  2. 在Centos上安装docker,部署mysql数据库

    何为docker? Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级.可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化. 本机环境 24小时不关机的Centos ...

  3. 利用Docker快速部署Mysql

    写在前面 我又来更新了~~~,今天内容较少,主要是利用Docker快速部署Mysql和初始化数据 利用Docker下载Mysql 简洁明了,在命令提示符中输入 docker pull mysql:8. ...

  4. 如何利用 docker 快速部署 Mysql 服务

    docker 基础教程不再多说,这里只着重讲如何使用 docker 部署 mysql 服务 docker 拉取 访问 dockerhub,搜索关键词 mysql,我这里选择 mysql-server, ...

  5. 一分钟在云端快速创建MySQL数据库实例

    本教程将帮助您了解如何使用Azure管理门户迅速创建,连接,配置MySQL 数据库 on Azure.完成本教程后,您将在Azure上拥有一个示例MySQL数据库服务器,并了解如何使用管理门户执行基本 ...

  6. 打通版微社区(2):服务器部署MySql数据库 For DZ3.2

    写在前面:单独写部署MySql原因是,我这边的应用数据库都是独立存在的,数据与应用分别部署在不同的服务器.另外我也没有实际部署MySql的经验,特意写一篇日志,张记性.安装MySql参考了http:/ ...

  7. 这38个小技巧告诉你如何快速学习MySQL数据库2

    1.如何快速掌握MySQL? ⑴培养兴趣兴趣是最好的老师,不论学习什么知识,兴趣都可以极大地提高学习效率.当然学习MySQL 5.6也不例外.⑵夯实基础计算机领域的技术非常强调基础,刚开始学习可能还认 ...

  8. 这38个小技巧告诉你如何快速学习MySQL数据库

    1.如何快速掌握MySQL? ⑴培养兴趣兴趣是最好的老师,不论学习什么知识,兴趣都可以极大地提高学习效率.当然学习MySQL 5.6也不例外.⑵夯实基础计算机领域的技术非常强调基础,刚开始学习可能还认 ...

  9. Windows Server系统部署MySQL数据库

    由于工作需要在阿里云服务器中使用MySQL,所以安装一下MySQL数据库,中间也踩了一些坑,现在将整个过程给大家记录下来,便于后续查找. 阿里云服务器是WinServer2012系统,之前在Windo ...

随机推荐

  1. taro 知识点

    taro 的包: 包名 说明 @tarojs/redux Redux for Taro @tarojs/redux-h5 Forked react-redux for taro @tarojs/plu ...

  2. TypeScript 之 声明文件的发布

    https://www.tslang.cn/docs/handbook/declaration-files/publishing.html 发布声明文件到npm,有两种方式: 与你的npm包捆绑在一起 ...

  3. [VC6] 小谈如何解决VC6.0 open崩溃的问题(已解决)(转)

    [昨天重装了系统,开始用VC6还是可以的,后来装了WPS,在用VC6里面的Open就崩溃了. 这个解决方法就这么几步:1.把FileTool.dll放到指定的AddIns目录.2. 注册这个dll到注 ...

  4. LOJ 2587 「APIO2018」铁人两项——圆方树

    题目:https://loj.ac/problem/2587 先写了 47 分暴力. 对于 n<=50 的部分, n3 枚举三个点,把图的圆方树建出来,合法条件是 c 是 s -> f 路 ...

  5. 静态Map类型变量赋初始值

    private static Map<String,String> sysTypeList = new HashMap<String, String>(); static { ...

  6. Spark应用HanLP对中文语料进行文本挖掘--聚类详解教程

    软件:IDEA2014.Maven.HanLP.JDK: 用到的知识:HanLP.Spark TF-IDF.Spark kmeans.Spark mapPartition; 用到的数据集:http:/ ...

  7. hadoop需要哪些技术支持

    hadoop是一个开源软件框架,可安装在一个商用机器集群中,使机器可彼此通信并协同工作,以高度分布式的方式共同存储和处理大量数据.最初,Hadoop 包含以下两个主要组件:Hadoop Distrib ...

  8. 【转】 Ubuntu在启动器添加程序快捷方式

     转自: http://blog.csdn.net/walker0411/article/details/51555821 目录(?)[-] Ubuntu在启动器添加程序 eclipse快捷方式的创建 ...

  9. 使用Selenium模拟浏览器抓取淘宝商品美食信息

    代码: import re from selenium import webdriver from selenium.webdriver.common.by import By from seleni ...

  10. C#、AE开发入门之打开TIFF文件并显示

    继上篇文章,本次打开TIFF文件,附上源码及其注释 private void button2_Click(object sender, EventArgs e) { axMapControl1.Cle ...