前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >CentOS7.2下安装MySQL-5.7.18RPM Bundle版(适用于最新版5.7.20)

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

作者头像
耕耘实录
发布2018-12-20 12:15:37
9730
发布2018-12-20 12:15:37
举报
文章被收录于专栏:耕耘实录耕耘实录

版权声明:本文为耕耘实录原创文章,各大自媒体平台同步更新。欢迎转载,转载请注明出处,谢谢。

一、环境

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。

代码语言:javascript
复制
[root@Geeklp-MySQL ~]# yum -y install wget

2、下载安装包。

代码语言:javascript
复制
wget -c http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.18-1.el5.i686.rpm-bundle.tar

3、解包。

代码语言:javascript
复制
[root@Geeklp-MySQL ~]# tar -xf mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar

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

代码语言:javascript
复制
#!/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服务,记录初始密码。

代码语言:javascript
复制
[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、初次登录,修改登录密码。

代码语言:javascript
复制
[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配置文件。

代码语言:javascript
复制
[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

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017年12月13日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一、环境
  • 二、安装过程
  • 三、配置过程
相关产品与服务
云数据库 SQL Server
腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档