CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了CentOS 7 RPM 安装 MySQL5.7大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

0、环境 本文操作系统: CentOS 7.2.1511 x86_64 MySQL 版本: 5.7.18 1、卸载系统自带的 mariadb-lib [root@centos-linux ~]# rpm -qa|grep mariadb mariadb-libs-5.5.44-2.el7.centos.x86_64 [root@centos-linux ~]# rpm -e mariadb-lib

0、环境

1、卸载系统自带的 mariadb-lib

[root@centos-linux ~]# rpm -qa|grep mariadb
mariadb-libs-5.5.44-2.el7.centos.x86_64
[root@centos-linux ~]# rpm -e mariadb-libs-5.5.44-2.el7.centos.x86_64 --nodeps

2、下载 rpm 安装包

[root@centos-linux ~]# wget https://downloads.MysqL.com/archives/get/file/MysqL-5.7.18-1.el7.x86_64.rpm-bundle.tar

然后解压

[root@centos-linux ~]# ls
MysqL-5.7.18-1.el7.x86_64.rpm-bundle.tar
[root@centos-linux ~]# tar -xvf MysqL-5.7.18-1.el7.x86_64.rpm-bundle.tar
MysqL-community-server-5.7.18-1.el7.x86_64.rpm
MysqL-community-embedded-devel-5.7.18-1.el7.x86_64.rpm
MysqL-community-devel-5.7.18-1.el7.x86_64.rpm
MysqL-community-client-5.7.18-1.el7.x86_64.rpm
MysqL-community-common-5.7.18-1.el7.x86_64.rpm
MysqL-community-embedded-5.7.18-1.el7.x86_64.rpm
MysqL-community-embedded-compat-5.7.18-1.el7.x86_64.rpm
MysqL-community-libs-5.7.18-1.el7.x86_64.rpm
MysqL-community-server-minimal-5.7.18-1.el7.x86_64.rpm
MysqL-community-test-5.7.18-1.el7.x86_64.rpm
MysqL-community-minimal-debuginfo-5.7.18-1.el7.x86_64.rpm
MysqL-community-libs-compat-5.7.18-1.el7.x86_64.rpm

3、安装

[root@centos-linux ~]# rpm -ivh MysqL-community-common-5.7.18-1.el7.x86_64.rpm 
[root@centos-linux ~]# rpm -ivh MysqL-community-libs-5.7.18-1.el7.x86_64.rpm
[root@centos-linux ~]# rpm -ivh MysqL-community-client-5.7.18-1.el7.x86_64.rpm
[root@centos-linux ~]# rpm -ivh MysqL-community-server-5.7.18-1.el7.x86_64.rpm 
@H_403_208@4、数据库初始化
MysqLd --initialize --user=MysqL
[root@centos-linux ~]# cat /var/log/MysqLd.log
2016-07-16T07:56:38.282824Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-07-16T07:56:38.422114Z 0 [Warning] InnoDB: New log files created,LSN=45790
2016-07-16T07:56:38.449315Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-07-16T07:56:38.457910Z 0 [Warning] No existing UUID has been found,so we assume that this is the first time that this server has been started. Generating a new UUID: d3261dbf-4b2a-11e6-86ef-001c4260563f.
2016-07-16T07:56:38.458976Z 0 [Warning] Gtid table is not ready to be used. Table 'MysqL.gtid_executed' cannot be opened.
2016-07-16T07:56:38.459524Z 1 [Note] A temporary password is generated for root@localhost: hm9dKgzQdm:W
[root@centos-linux ~]# systemctl start MysqLd
[root@centos-linux ~]# MysqL -uroot -p
Enter password:
Welcome to the MysqL monitor.  Commands end with ; or \g.
Your MysqL connection id is 2
Server version: 5.7.13

Copyright (c) 2000,2016,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、修改 root 密码

MysqL> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
MysqL> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
MysqL> ALTER USER 'root'@'localhost' IDENTIFIED BY '123';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

大佬总结

以上是大佬教程为你收集整理的CentOS 7 RPM 安装 MySQL5.7全部内容,希望文章能够帮你解决CentOS 7 RPM 安装 MySQL5.7所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: