博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Centos 7下mysql 8.0.11的rpm包的安装方式
阅读量:4113 次
发布时间:2019-05-25

本文共 3004 字,大约阅读时间需要 10 分钟。

1.系统版本及mysql下载地址

操作系统:Centos 7.4

mysql数据库版本:mysql8.0.11

mysql官方网站:

2.安装新版mysql之前,我们需要将系统自带的mariadb-lib卸载

[bigdata@eric011 software-package]$ rpm -qa|grep mariadbmariadb-libs-5.5.56-2.el7.x86_64[bigdata@eric011 software-package]$ sudo rpm -e mariadb-libs-5.5.56-2.el7.x86_64 --nodeps

3.到mysql的官网下载最新版mysql的rpm集合包:mysql-8.0.11-1.el7.x86_64.rpm-bundle.tar

4.上传mysql-8.0.11-1.el7.x86_64.rpm-bundle.tar到linux服务器,并解压tar包

[bigdata@eric011 mysql]$ lsmysql-community-client-8.0.11-1.el7.x86_64.rpm           mysql-community-libs-8.0.11-1.el7.x86_64.rpm               mysql-community-server-minimal-8.0.11-1.el7.x86_64.rpmmysql-community-common-8.0.11-1.el7.x86_64.rpm           mysql-community-libs-compat-8.0.11-1.el7.x86_64.rpm        mysql-community-test-8.0.11-1.el7.x86_64.rpmmysql-community-devel-8.0.11-1.el7.x86_64.rpm            mysql-community-minimal-debuginfo-8.0.11-1.el7.x86_64.rpmmysql-community-embedded-compat-8.0.11-1.el7.x86_64.rpm  mysql-community-server-8.0.11-1.el7.x86_64.rpm

5.其中最简单的安装mysql-server服务,只需要安装如下4个软件包即可,我们可以使用rpm -ivh命令进行安装

sudo rpm -ivh mysql-community-common-8.0.11-1.el7.x86_64.rpmsudo rpm -ivh mysql-community-libs-8.0.11-1.el7.x86_64.rpm --(依赖于common)sudo rpm -ivh mysql-community-client-8.0.11-1.el7.x86_64.rpm --(依赖于libs)sudo rpm -ivh mysql-community-server-8.0.11-1.el7.x86_64.rpm --(依赖于client、common)

注意:这一步可能遇到报错

[bigdata@eric011 mysql]$ sudo rpm -ivh mysql-community-server-8.0.11-1.el7.x86_64.rpm 警告:mysql-community-server-8.0.11-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY错误:依赖检测失败:	libaio.so.1()(64bit) 被 mysql-community-server-8.0.11-1.el7.x86_64 需要	libaio.so.1(LIBAIO_0.1)(64bit) 被 mysql-community-server-8.0.11-1.el7.x86_64 需要	libaio.so.1(LIBAIO_0.4)(64bit) 被 mysql-community-server-8.0.11-1.el7.x86_64 需要

解决方法:yum install libaio

6.初始化mysql数据库

[bigdata@eric011 mysql]$ sudo mysqld --initialize  //该命令会在/var/log/mysqld.log生成随机密码

7.修改mysql数据库目录的所属用户及其所属组,然后启动mysql数据库

[bigdata@eric011 lib]$ sudo chown mysql:mysql /var/lib/mysql -R[bigdata@eric011 lib]$ systemctl start mysqld.service

8.根据第6步中的密码,更改root用户的密码,新版的mysql必须先修改root用户的密码,否则登录后是不能执行任何命令的

[bigdata@eric011 lib]$ mysql_secure_installation  //根据提示修改root用户密码

9.安装完成,接下来既可以正常操作mysql

[bigdata@eric011 lib]$ mysql -uroot -pxxxxmysql: [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 13Server version: 8.0.11 MySQL Community Server - GPLCopyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;+--------------------+| Database           |+--------------------+| information_schema || mysql              || performance_schema || sys                |+--------------------+4 rows in set (0.01 sec)mysql> exit
版权声明:本文为博主原创文章,转载请注明出处!

你可能感兴趣的文章
Visual C#2005中的匿名委托的实现
查看>>
C#几种常用的排序算法
查看>>
C#中调用Windows API的要点
查看>>
C#开发终端式短信的原理和方法
查看>>
使用P/Invoke来开发用于与串行设备通讯的.NET基类
查看>>
NET 2.0 中的自定义配置处理
查看>>
区别C#中的两个属性(Property和Attribute)
查看>>
利用反射来动态创建实例和调用方法
查看>>
Winform中多国语言窗体的设计以及.NET中资源文件的使用
查看>>
61条面向对象设计的经验原则---Arthur J.Riel
查看>>
.NET反编译工具Reflector及插件
查看>>
2007中国理财年度人物评选榜单揭晓
查看>>
牢记卖股票的四大纪律十项注意
查看>>
权证操作心得
查看>>
月亮私房菜——秘制辣椒油!让你辣得够味!辣得过瘾!
查看>>
内存读写错误??这样搞定它!
查看>>
饺子的10种包法
查看>>
下月起苏州实施扩大儿童免疫规划
查看>>
市民常用电话名录
查看>>
妙!二十九招驱蚊止痒不再愁
查看>>