mysql rpm 5.7.20安装_CentOS7.2下安装MySQL-5.7.18RPM Bundle版(适用于最新版5.7.20)

CentOS7.2下安装MySQL-5.7.18RPM Bundle版(适用于最新版5.7.20)

一、环境

1、操作系统:CentOS Linux release 7.2.1511 (Core) 最小化安装版

2、MySQL版本:MySQL-5.7.18(mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar)

二、安装过程

1、安装wget。

[root@Geeklp-MySQL ~]# yum -y install wget

2、下载安装包。

wget -c http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.18-1.el5.i686.rpm-bundle.tar

3、解包。

[root@Geeklp-MySQL ~]# tar -xf mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar

4、按照以下脚本顺序安装各rpm包及其他依赖包。

#!/bin/bash

yum -y install net-tools

tar -xf mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar &

yum -y remove mariadb-libs

rpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm

rpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm

rpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm

rpm -ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm

yum -y install perl-Getopt-Long

rpm -ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm

yum -y install perl-Data-Dumper

yum -y install perl-JSON

rpm -ivh mysql-community-test-5.7.18-1.el7.x86_64.rpm

rpm -ivh mysql-community-devel-5.7.18-1.el7.x86_64.rpm

5、启动MySQL服务,记录初始密码。

[root@Geeklp-MySQL ~]# systemctl start mysqld

[root@Geeklp-MySQL ~]# cat /var/log/mysqld.log |grep password

2017-12-13T10:50:44.960028Z 1 [Note] A temporary password is generated for root@localhost: =mWoe;zkj4M3

至此,安装过程完成。

三、配置过程

1、初次登录,修改登录密码。

[root@Geeklp-MySQL ~]# # mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.7.18

Copyright (c) 2000, 2017, 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('xwumpmysql,./');

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

mysql> SET PASSWORD = PASSWORD('Geeklp.0/7');

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> quit;

Bye

2、创建数据目录,修改my.cfn配置文件。

[root@Geeklp-MySQL ~]# mkdir /home/data

[root@Geeklp-MySQL ~]# mv /var/lib/mysql /home/data/

[root@Geeklp-MySQL ~]# vi /etc/my.cnf

default-storage-engine=INNODB

lower_case_table_names = 1

其他更详配置尽介绍请参阅:https://dev.mysql.com/doc/refman/5.7/en/mysqld-option-tables.html

权限重置敬请参阅:https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值