Last login: Sun Dec 24 04:55:59 2017

1、安装依赖

[root@node001 ~]# yum install -y perl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
Setting up Install Process
Package 4:perl-5.10.1-144.el6.x86_64 already installed and latest version
Nothing to do

2、 卸载旧版本的mysql及插件

[root@node001 ~]# rpm -qa | grep mysql
mysql-5.1.73-8.el6_8.x86_64
mysql-libs-5.1.73-8.el6_8.x86_64
mysql-server-5.1.73-8.el6_8.x86_64

[root@node001 ~]# rpm -e mysql-5.1.73-8.el6_8.x86_64 --nodeps

[root@node001 ~]# rpm -e mysql-libs-5.1.73-8.el6_8.x86_64 --nodeps

[root@node001 ~]# rpm -e mysql-server-5.1.73-8.el6_8.x86_64 --nodeps

(--nodeps:忽略其他依赖,直接卸载)

3、 安装rpm(4个)

安装包

[root@node001 ~]# tar zxvf mysql.tar.gz
MySQL-client-5.6.28-1.el6.x86_64.rpm
MySQL-devel-5.6.28-1.el6.x86_64.rpm
MySQL-server-5.6.28-1.el6.x86_64.rpm
numactl-2.0.9-2.el6.x86_64.rpm

[root@node001 ~]# rpm -ivh MySQL-client-5.6.28-1.el6.x86_64.rpm
warning: MySQL-client-5.6.28-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]

[root@node001 ~]# rpm -ivh MySQL-devel-5.6.28-1.el6.x86_64.rpm
warning: MySQL-devel-5.6.28-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-devel ########################################### [100%]

[root@node001 ~]# rpm -ivh numactl-2.0.9-2.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:numactl ########################################### [100%]

[root@node001 ~]# rpm -ivh MySQL-server-5.6.28-1.el6.x86_64.rpm
warning: MySQL-server-5.6.28-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
2017-12-24 05:39:08 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestam
p server option (see documentation for more details).2017-12-24 05:39:08 0 [Note] /usr/sbin/mysqld (mysqld 5.6.28) starting as process 1287 ...
2017-12-24 05:39:08 1287 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-12-24 05:39:08 1287 [Note] InnoDB: The InnoDB memory heap is disabled
2017-12-24 05:39:08 1287 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-12-24 05:39:08 1287 [Note] InnoDB: Memory barrier is not used
2017-12-24 05:39:08 1287 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-12-24 05:39:08 1287 [Note] InnoDB: Using Linux native AIO
2017-12-24 05:39:08 1287 [Note] InnoDB: Using CPU crc32 instructions
2017-12-24 05:39:08 1287 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-12-24 05:39:08 1287 [Note] InnoDB: Completed initialization of buffer pool
2017-12-24 05:39:08 1287 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created

.............................

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 /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

4、上传mysql配置文件my.cnf

[root@node001 ~]# cd /etc

上传文件

[root@node001 etc]# ls /etc/my.cnf
/etc/my.cnf

5、初始化

[root@node001 etc]# /usr/bin/mysql_install_db
Installing MySQL system tables...2017-12-24 05:41:57 0 [Note] /usr/sbin/mysqld (mysqld 5.6.28-log) starting as process 1353 ...
2017-12-24 05:41:57 1353 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-12-24 05:41:57 1353 [Note] InnoDB: The InnoDB memory heap is disabled
2017-12-24 05:41:57 1353 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-12-24 05:41:57 1353 [Note] InnoDB: Memory barrier is not used
2017-12-24 05:41:57 1353 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-12-24 05:41:57 1353 [Note] InnoDB: Using Linux native AIO
2017-12-24 05:41:57 1353 [Note] InnoDB: Using CPU crc32 instructions
2017-12-24 05:41:57 1353 [Note] InnoDB: Initializing buffer pool, size = 64.0M
2017-12-24 05:41:57 1353 [Note] InnoDB: Completed initialization of buffer pool
2017-12-24 05:41:57 1353 [Note] InnoDB: Highest supported file format is Barracuda.
2017-12-24 05:41:57 1353 [Warning] InnoDB: Resizing redo log from 2*3072 to 3*2048 pages, LSN=1625987
....................

WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

6、  启动mysql

[root@node001 etc]# service mysql start
Starting MySQL....... SUCCESS!

7、重置密码

查看初始化密码

[root@node001 etc]# cat /root/.mysql_secret
# The random password set for the root user at Sun Dec 24 05:39:11 2017 (local time): DMBe85LznCxRo16N

[root@node001 etc]# mysql -u root -pDMBe85LznCxRo16N
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.28-log

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> set password=password('mysql');
Query OK, 0 rows affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)

8、远程授权

原因:默认远程无法连接

授权命令:

mysql> grant all privileges on *.* to 'root'@'%' identified by 'mysql' with grant option;
Query OK, 0 rows affected (0.00 sec)

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

在centos中安装mysql详细步骤说明的更多相关文章

  1. Linux1 在Linux(CentOS)上安装MySql详细记录

    前记:  毕业两年了,前两天换了份工作,由以前的传统行业跳到了互联网行业.之前的公司一直在用WinServer2003+Tomcat+SqlServer/Oracle这套部署环境.对于Linux+To ...

  2. Linux CentOS 中安装 MySql

    CentOS7的yum源中默认好像是没有mysql的.为了解决这个问题,我们要先下载mysql的repo源. 1. 下载mysql的repo源 $ wget http://repo.mysql.com ...

  3. linux安装mysql详细步骤

    最近买了个腾讯云服务器,搭建环境. 该笔记用于系统上未装过mysql的干净系统第一次安装mysql.自己指定安装目录,指定数据文件目录. linux系统版本: CentOS 7.3 64位 安装源文件 ...

  4. linux 使用yum安装mysql详细步骤

    环境:Centos 6.5 Linux 使用yum命令安装mysql 1. 先检查系统是否装有mysql [root@localhost ~]#yum list installed mysql* [r ...

  5. centos中安装mysql

    一.首先输入指令 rpm -qa|grep mysql 检查操作系统中是否已经安装了MySQL 可以通过 yum list | grep mysql 命令来查看yum上提供的mysql数据库可下载的版 ...

  6. linux下安装mysql详细步骤

    最近买了个阿里云服务器,搭建mysql环境. 该笔记用于系统上未装过mysql的干净系统第一次安装mysql.自己指定安装目录,指定数据文件目录. linux系统版本: CentOS 7.3 64位 ...

  7. ubuntu16.04下安装mysql详细步骤

    1.如果要搭建服务器先去购买一个云主机,比如阿里云.京东云.新网等等都有卖.这里推荐使用京东云服务器,因为最近在搞活动.一元可体验两个月(可能现在活动已经过了,但在京东云里有免费领一个月的,学生机也有 ...

  8. Linux安装MySQL详细步骤(CentOS6、CentOS7)

    1.查看mysql的依赖(centos7 要把mysql改成mariadb) rpm -qa | grep mysql 2.删除mysql的依赖,可以两个都执行(centos7 要把mysql改成ma ...

  9. centos中安装mysql数据库

    1.查看是否已有mysql数据库: #rpm -qa |grep mysql 命令返回空,说明没有安装成功. 2.安装mysql yum install mysql* 安装完成后,却发现只安装了JDB ...

随机推荐

  1. fetch初步了解

    前言 对于ajax请求,我们不仅可以使用XMLHTTPrequest,还可以使用fetch 正文 promise 在使用ajax时,如果想要使得第二个ajax请求调用第一个ajax请求,就得使用在on ...

  2. 【BZOJ 2186】 2186: [Sdoi2008]沙拉公主的困惑 (欧拉筛,线性求逆元)

    2186: [Sdoi2008]沙拉公主的困惑 Description 大富翁国因为通货膨胀,以及假钞泛滥,政府决定推出一项新的政策:现有钞票编号范围为1到N的阶乘,但是,政府只发行编号与M!互质的钞 ...

  3. 【UOJ #201】【CTSC 2016】单调上升路径

    http://uoj.ac/problem/201 别人都一眼秒的题对我而言怎么那么难qwq 这道题就是要构造一个n*n的邻接矩阵,满足矩阵\(A\)是一个拉丁方阵(也是数独?),\(a_{ij}=a ...

  4. [Atcoder Grand Contest 004] Tutorial

    Link: AGC004 传送门 A: …… #include <bits/stdc++.h> using namespace std; long long a,b,c; int main ...

  5. ccpc秦皇岛部分题解

    A. 题意:就是有一个大桌子,环绕有顺势站1~m共m个座位,n个选手坐在部分位置上.然后如果有一个人a了一道题,却没有立刻发气球给他,他产生怒气值是发气球给他的时间减去a题时间.现在有一个机器人顺时针 ...

  6. BZOJ 4884 [Lydsy2017年5月月赛]太空猫(单调DP)

    [题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=4884 [题目大意] 太空猫(SpaceCat)是一款画面精致.玩法有趣的休闲游戏, 你 ...

  7. (疯狂java)第四课(上)

    趁着周末玩爽了,兴致来了,继续玩玩java(估计再玩下去,就要被java玩了),第六章实在是很长,那就两个阶段来看吧. 1.java 7的增强包装类 这些包装类就是java上的基本类型,只不过人人基本 ...

  8. [转]JSP中常见的Tomcat报错错误解析(一)

    1**:请求收到,继续处理2**:操作成功收到,分析.接受3**:完成此请求必须进一步处理4**:请求包含一个错误语法或不能完成5**:服务器执行一个完全有效请求失败 100——客户必须继续发出请求1 ...

  9. Matlab横坐标从特定值开始

    set(gca,'XTick',1:1:length(x)); set(gca,'XTickLabel',{'15','20','25','30','35','40','45','50','55',' ...

  10. [转] EPSG CODE的含义

    董雨    原文地址 之前一直对WKT.EPSG.SRID不是很理解,总是混淆,今天看了一下,清晰了很多,顺便总结一下,嘿嘿:) EPSG(欧洲石油调查小组):European Petroleum S ...