Centos Yum 安装 Mysql 5.7
Centos 6 / 7 官方源安装Mysql 5.7
1 检查当前系统是否有旧版本
# rpm -qa | grep mysql
mysql-libs-5.1.71-1.el6.x86_64
# rpm -qa | grep MySQL
1.1 如有旧版本可以删除
# rpm -e mysql-libs-5.1.71-1.el6.x86_64 --nodeps
2 下载MySQL官方 Yum Repository
根据系统下载6或7
(6) wget -i http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
(7) wget -i http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
如果发现证书错误需要添加参数:
wget --no-check-certificate http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
3 安装和确认仓库内容
3.1 安装
3.2 检查有效仓库
# yum repolist enabled
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
repo id repo name status
base CentOS-6 - Base 6,713
extras CentOS-6 - Extras 47
mysql-connectors-community MySQL Connectors Community 129
mysql-tools-community MySQL Tools Community 90
mysql57-community MySQL 5.7 Community Server 396
updates CentOS-6 - Updates 1,046
repolist: 8,421
3.3 查询安装版本
# yum list mysql-community*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Available Packages
mysql-community-client.i686 5.7.30-1.el6 mysql57-community
mysql-community-client.x86_64 5.7.30-1.el6 mysql57-community
mysql-community-common.i686 5.7.30-1.el6 mysql57-community
mysql-community-common.x86_64 5.7.30-1.el6 mysql57-community
mysql-community-devel.i686 5.7.30-1.el6 mysql57-community
mysql-community-devel.x86_64 5.7.30-1.el6 mysql57-community
mysql-community-embedded.i686 5.7.30-1.el6 mysql57-community
mysql-community-embedded.x86_64 5.7.30-1.el6 mysql57-community
mysql-community-embedded-devel.i686 5.7.30-1.el6 mysql57-community
mysql-community-embedded-devel.x86_64 5.7.30-1.el6 mysql57-community
mysql-community-libs.i686 5.7.30-1.el6 mysql57-community
mysql-community-libs.x86_64 5.7.30-1.el6 mysql57-community
mysql-community-libs-compat.i686 5.7.30-1.el6 mysql57-community
mysql-community-libs-compat.x86_64 5.7.30-1.el6 mysql57-community
mysql-community-release.noarch el6-5 mysql-connectors-community
mysql-community-server.x86_64 5.7.30-1.el6 mysql57-community
mysql-community-test.x86_64 5.7.30-1.el6 mysql57-community
4 安装
# yum install mysql-server
Dependencies Resolved
===========================================================================================================
Package Arch Version Repository Size
===========================================================================================================
Installing:
mysql-community-server x86_64 5.7.30-1.el6 mysql57-community 162 M
Installing for dependencies:
mysql-community-client x86_64 5.7.30-1.el6 mysql57-community 25 M
mysql-community-common x86_64 5.7.30-1.el6 mysql57-community 370 k
mysql-community-libs x86_64 5.7.30-1.el6 mysql57-community 2.4 M
numactl x86_64 2.0.9-2.el6 base 74 k
Transaction Summary
===========================================================================================================
Install 5 Package(s)
Total download size: 189 M
Installed size: 905 M
Is this ok [y/N]:
5 数据库初始化
5.1 启动mysql 服务
# service mysqld start
Initializing MySQL database: [ OK ]
Starting mysqld: [ OK ]
5.2 查看初始密码
# grep password /var/log/mysqld.log
[Note] A temporary password is generated for root@localhost: l#.&dX3Hgade
[Note] Access denied for user 'UNKNOWN_MYSQL_USER'@'localhost' (using password: NO)
5.3 登录
# mysql -u root -pl#.&dX3Hgade
Server version: 5.7.30
Copyright (c) 2000, 2020, 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>
5.4 更改初始密码(必须更改初始密码,默认策略大小写数字加特殊字符)
mysql> use mysql;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statemen
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password-8888';
5.5 确认和修改密码策略
mysql> show variables like '%password%';
# vi /etc/my.cnf
添加 validate_password_policy配置
选择 0(LOW),1(MEDIUM),2(STRONG)其中一种,选择2需要提供密码字典文件
# 添加validate_password_policy配置
validate_password_policy=0
# 关闭密码策略
validate_password = off
修改后重启服务
5.6 添加远程管理权限
mysql > grant all privileges on *.* to 'root'@'192.168.1.1' identified by 'password' with grant option;
mysql > flush privileges;
Centos Yum 安装 Mysql 5.7的更多相关文章
- centos yum 安装 mysql
centos7下使用yum安装mysql 时间:2015-03-07 21:26:20 阅读:87445 评论:0 收藏:1 [点我收藏+] 标签: Cen ...
- centos yum安装mysql
查看有没有安装包 # yum list mysql 安装mysql客户端 # yum install mysql # yum list mysql-server 安装mysql 服务器端 # yum ...
- Centos yum 安装mysql报错 No package mysql-server available.
这是因为大多数mysql-*的资源名称被mariadb-*重命名了 所以换成 yum install mariadb-server 就可以了 PS[摘自网络] MariaDB不仅仅是Mysql的一个替 ...
- 阿里云服务器Linux CentOS安装配置(三)yum安装mysql
阿里云服务器Linux CentOS安装配置(三)yum安装mysql 1.执行yum安装mysql命令:yum -y install mysql-server mysql-devel 2.启动mys ...
- CentOS 7.0下使用yum安装MySQL
CentOS7默认数据库是mariadb,配置等用着不习惯,因此决定改成mysql,但是CentOS7的yum源中默认好像是没有mysql的.为了解决这个问题,我们要先下载mysql的repo源. 1 ...
- centos yum 安装php mysql
1 安装php7 查看 centos 版本 # cat /etc/centos-release 删除之前的 php 版本 # yum remove php* php-common rpm 安装 Php ...
- 使用yum方式在centOS上安装mysql
1.操作系统及MySQL版本 1.1 操作系统版本 CentOS release 6.5 (Final) 1.2 MySQL版本 mysql-5.1.73-3.el6_5.x86_64mysql-li ...
- centOS Linux下用yum安装mysql
centOS Linux下用yum安装mysql 第一篇:安装和配置MySQL 第一步:安装MySQL [root@192 local]# yum -y install mysql- ...
- 在 CentOS 7.5 64位上使用 yum 安装 MySQL 8.0
前段时间在 CentOS 7.5 64位上安装 MySQL 8.0.查了些资料,在这里记录一下详细的安装和设置步骤. 一.安装 使用yum安装MySQL之前需要先下载对应的.rpm文件,下载方法: 去 ...
随机推荐
- 容器随Docker启动而启动
在容器开启状态下 docker container update --restart=always 容器名
- 【原创】简单解释一下,什么叫TLAB
[Deerhang] TLAB是全程Thread Local Allocation Buffer,中文大致的含义是:线程私有内存分配区.它存在的意义是提高线程在JVM堆上创建对象的效率.那么它是如何做 ...
- JVM核心技术(第一篇)
目录 Java基础知识 一. 字节码技术 二.JVM类加载器 类的加载时机 三.JVM内存结构 四.JVM启动参数 4.1 系统属性参数 4.2 运行模式 4.3 堆内存 4.4 GC相关 4.5 分 ...
- [Java] 开课吧--JVM
双亲委派 向上委托,向下加载 收到加载任务后,先交给父类加载器,只有当父类加载器无法完成,才会执行加载 保证只有一个类加载器加载,避免重复加载 破坏:JDK 1.2后才使用,JDK 1.1的核心类没 ...
- 用 set follow-fork-mode child即可。这是一个 gdb 命令,其目的是告诉 gdb 在目标应用调用fork之后接着调试子进程而不是父进程,因为在 Linux 中fork系统调用成功会返回两次,一次在父进程,一次在子进程
GDB的那些奇淫技巧 evilpan 收录于 Security 2020-09-13 约 5433 字 预计阅读 11 分钟 709 次阅读 gdb也用了好几年了,虽然称不上骨灰级玩家,但 ...
- 安装 Centos 7.x
学习 python 至今,一直是在 linux 上操作,感觉还是 linux 对 python 的支持更加友好,默认安装了 python 的版本 2 和 3 .为了打造更好的 python 开发环境, ...
- 服务器硬件必须支持M2 或PCIE才能支持NVME
兆芯服务器不支持NVME. 服务器硬件必须支持M2 或PCIE才能支持NVME.1 因为物理接口只有M2 SATA 和PCIE这三中但是NVME只支持M2 和PCIE这2种2所以 NVME不支持SAT ...
- Kubernetes 部署微服务电商平台(16)
一.概念 微服务就是很小的服务,小到一个服务只对应一个单一的功能,只做一件事.这个服务可以单独部署运行,服务之间可以通过RPC来相互交互,每个微服务都是由独立的小团队开发,测试,部署,上线,负责它的整 ...
- scala :: , +:, :+ , ::: , ++ 的区别
4 种操作符的区别和联系 :: 该方法被称为cons,意为构造,向队列的头部追加数据,创造新的列表.用法为 x::list,其中x为加入到头部的元素,无论x是列表与否,它都只将成为新生成列表的第一个元 ...
- exec函数族实例解析-(转自blankqdb)
fork()函数通过系统调用创建一个与原来进程(父进程)几乎完全相同的进程(子进程是父进程的副本,它将获得父进程数据空间.堆.栈等资源的副本.注意,子进程持有的是上述存储空间的"副本&quo ...