• 操作系统Centos 6.10 64位
  • Mysql 版本 5.7.27 , 从官网下载
  • 该教程是Mysql shell安装脚本,脚本运行结束后需要重置密码,以及必要的授权操作等
  • 该教程对外端口设置为50000
  • 该教程Mysql 的BASE 路径是 /usr/local/mysql/app/mysql
  • 该教程Mysql 的 DATA 路径是 /usr/local/mysql/data/
#!/bin/bash
yum install wget numactl libaio-devel -y
rpm -qa |grep mysql mkdir /usr/local/mysql
mkdir -p /usr/local/mysql/app
mkdir -p /usr/local/mysql/data/
mkdir -p /usr/local/mysql/log/ cd /usr/local/src/
#wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz
wget -O mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz http://download.zhufunin.com/mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz
tar zxf mysql-5.7.-linux-glibc2.-x86_64.tar.gz
mv /usr/local/src/mysql-5.7.-linux-glibc2.-x86_64 /usr/local/mysql/app/mysql groupadd mysql
useradd -r -g mysql -s /bin/false mysql cat > /etc/my.cnf <<EOF [client]
default-character-set=utf8
socket=/tmp/mysql.sock
[mysqld]
#skip-name-resolve
port =
socket = /tmp/mysql.sock
basedir = /usr/local/mysql/app/mysql
datadir= /usr/local/mysql/data/
character-set-server=utf8
skip-character-set-client-handshake=
default-storage-engine=INNODB
max_allowed_packet = 500M
explicit_defaults_for_timestamp=
log-output=FILE
general_log=
general_log_file=/usr/local/mysql/log/general.log
slow_query_log = ON
slow_query_log_file = /usr/local/mysql/log/slow-query.log
long_query_time =
log-error = /usr/local/mysql/log/error.log
EOF chown -R mysql:mysql /usr/local/mysql/ /usr/local/mysql/app/mysql/bin/mysqld --defaults-file=/etc/my.cnf --initialize --user=mysql --basedir=/usr/local/mysql/app/mysql/ --datadir=/usr/local/mysql/data/ cp /usr/local/mysql/app/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod a+x /etc/init.d/mysqld chkconfig --add mysqld
service mysqld start ln -s /usr/local/mysql/app/mysql/bin/mysql /usr/local/bin/
echo "export PATH=$PATH:/usr/local/mysql/app/mysql/bin/" >> /etc/profile
source /etc/profile echo "***************************"
echo "***************************"
echo "Please read below carefully"
echo "***************************"
echo "***************************"
echo "You must change your root password before you do anythings"
echo "Below is your password"
echo "###########################"
tail - /usr/local/mysql/log/error.log|grep 'temporary password'|awk -F ':' '{print $4}'|awk '{print $1}'|tail -
echo "###########################"
echo "mysql -hlocalhost -uroot -p"
echo "ALTER USER 'root'@'localhost' IDENTIFIED BY 'YourNewPassword';"
echo "***************************"
echo "After you changed your passowrd, you can change root access right by follow commands"
echo "***************************"
echo "use mysql;"
echo "select host,user from user where user='root';"
echo "create USER 'root'@'%' IDENTIFIED BY 'YourPassword';"
echo "grant all privileges on *.* to 'root'@'%' with grant option;"

centos 6.10 安装mysql 5.7.27的更多相关文章

  1. centos 6.10 安装mysql 5.7.27 出现缺少libnuma.so.1的问题

    centos 6.10安装mysql 5.7.27出现以下报错: [root@localhost /]# /usr/local/mysql/app/mysql/bin/mysqld --default ...

  2. CentOS 6.10 安装mysql

    1.检查是否安装有mysql rpm -qa | grep mysql 使用yum remove 包  的方式删除干净 2.下载yum Repository wget -c  http://dev.m ...

  3. CentOS 6.9安装MySQL 5.6 (使用yum安装)

    CentOS 6.9安装MySQL 5.6 (使用yum安装) 移除CentOS默认的mysql-libs [root@test01 srv]# whereis mysqlmysql: /usr/li ...

  4. centOS 7 离线安装 MySQL 5.6 完美安装

    centOS 7 离线安装 MySQL 5.6 centOS 7 离线安装 MySQL 5.6 准备环境 1.离线 centOS 7(此处为 centOS 7 最小安装) 2.nginx 安装文件 ( ...

  5. CentOS 7.9 安装 MySQL 5.7.35

    CentOS 7.9 安装 MySQL 5.7.35 1 下载地址:https://downloads.mysql.com/archives/community/ 2 mysql5.7.35 安装包上 ...

  6. win 10 安装 mysql解压版 步骤

    参考资料:win 10 安装 mysql 5.7 网址:http://blog.sina.com.cn/s/blog_5f39af320102wbk0.html 本文参考上面的网址的教程,感谢作者分享 ...

  7. centos上如何安装mysql

    centos可以使用yum安装mysql 但是版本很低,且不灵活. 本文将介绍如何使用安装包安装mysql http://dev.mysql.com/downloads/mysql/ 下载mysql ...

  8. CentOS 7离线安装MySQL 5.7

    系列文章首发平台为果冻想个人博客.果冻想,是一个原创技术文章分享网站.在这里果冻会分享他的技术心得,技术得失,技术人生.我在果冻想等待你,也希望你能和我分享你的技术得与失,期待. 前言 网上已经有那么 ...

  9. centos 7 中安装 mysql 5.7

    centos 7 中安装 mysql 5.7 环境说明: 查看centos的版本:cat /etc/redhat-release 安装和配置步骤: 下载 mysql 源安装包: sudo curl - ...

随机推荐

  1. 任务调度问题(贪心) hdu4864

    传送门:http://acm.hdu.edu.cn/showproblem.php?pid=4864 The company hopes to maximize the number of the t ...

  2. XSS详解【1】---基本概念和攻击原理

    这节主要讲述XSS的基本概念和攻击原理. 一 XSS基本概念 人们经常将跨站脚本攻击(Cross Site Scripting)缩写为CSS,但这会与层叠样式表(Cascading Style She ...

  3. Codeforces Round #601 (Div. 2) E1 Send Boxes to Alice (Easy Version)

    #include <bits/stdc++.h> using namespace std; typedef long long ll; ; int a[N]; int n; bool pr ...

  4. CodeForces 1141A

    https://vjudge.net/problem/CodeForces-1141A #include <bits/stdc++.h> using namespace std; int ...

  5. Jquery change方法

    jQuery 事件 - change() 方法 当输入域发生变化时改变其颜色: $(".field").change(function(){ $(this).css("b ...

  6. Codeforces Round #622 (Div. 2)C(单调栈,DP)

    构造出的结果一定是一个单峰/\这种样子的 #define HAVE_STRUCT_TIMESPEC #include<bits/stdc++.h> using namespace std; ...

  7. php对数组排序 关联数组功能比较

    用php在国家统计局中抓取 省市区县 代码.名称.排序order id,处理方式是通过curl请求网址,正则匹配 获取信息,并保存为json文件,以便后期读取文件. 过程中或遇到对json文件转化为数 ...

  8. [Codechef CHSTR] Chef and String - 后缀数组

    [Codechef CHSTR] Chef and String Description 每次询问 \(S\) 的子串中,选出 \(k\) 个相同子串的方案有多少种. Solution 本题要求不是很 ...

  9. Leetcode 74. 搜索二维矩阵 C+

    二分法,先对行二分找出结果可能存在的行,再对这一行二分查找.O(Log m+Log n),m.n分别为矩阵的高和宽. class Solution { public: bool searchMatri ...

  10. Java连载77-Integer常用方法、Integer、int、String三者相互转化、自动装箱、自动拆箱

    一.关于Integer中常用的方法 package com.bjpowernode.java_learning; ​ public class D77_1_ { public static void ...