一、安装前准备

1、操作系统:CentOS 7.6

2、安装源的软件包: mysql80-community-release-el7-3.noarch.rpm

下载路径:mysql8在线安装源-Linux文档类资源-CSDN下载mysql8的CentOS7安装源更多下载资源、学习资料请访问CSDN下载频道.https://download.csdn.net/download/yuyuyuliang00/85014075

也可以到mysql官网下载:

二、安装步骤:

1、把mysql80-community-release-el7-3.noarch.rpm下载到待安装系统上:

[root@bjAli ~]# ls
bash  mysql80-community-release-el7-3.noarch.rpm  playbooks
[root@bjAli ~]#

2、安装mysql源的软件包:

[root@bjAli ~]# rpm -ivh mysql80-community-release-el7-3.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...1:mysql80-community-release-el7-3  ################################# [100%]
[root@bjAli ~]#

3、修改配置文件mysql-community.repo文件

[mysql80-community]
name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch/
enabled=1  ==> 设置为1
gpgcheck=0 ==> 设置为0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch/
enabled=1  ==> 设置为1
gpgcheck=0  ==> 设置为0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql[mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/7/$basearch/
enabled=1   ==> 设置为1
gpgcheck=0  ==> 设置为0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

4、用yum安装mysql-community-serve和mysql-community-client软件:

[root@bjAli yum.repos.d]# yum install mysql-community-server mysql-community-client
Loaded plugins: fastestmirror
...
Resolving Dependencies
--> Running transaction check
...
--> Finished Dependency ResolutionDependencies Resolved=========================================================================================================================================Package                                       Arch                  Version                      Repository                        Size
=========================================================================================================================================
Installing:mysql-community-client                        x86_64                8.0.28-1.el7                 mysql80-community                 53 Mmysql-community-server                        x86_64                8.0.28-1.el7                 mysql80-community                451 M
Installing for dependencies:mysql-community-client-plugins                x86_64                8.0.28-1.el7                 mysql80-community                5.7 Mmysql-community-common                        x86_64                8.0.28-1.el7                 mysql80-community                630 kmysql-community-icu-data-files                x86_64                8.0.28-1.el7                 mysql80-community                2.1 Mmysql-community-libs                          x86_64                8.0.28-1.el7                 mysql80-community                4.7 MTransaction Summary
=========================================================================================================================================
Install  2 Packages (+4 Dependent packages)Total download size: 517 M
Installed size: 2.4 G
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
......                                                            5/6Installing : mysql-community-server-8.0.28-1.el7.x86_64                                                                            6/6Verifying  : mysql-community-client-8.0.28-1.el7.x86_64                                                                            1/6Verifying  : mysql-community-server-8.0.28-1.el7.x86_64                                                                            2/6Verifying  : mysql-community-client-plugins-8.0.28-1.el7.x86_64                                                                    3/6Verifying  : mysql-community-common-8.0.28-1.el7.x86_64                                                                            4/6Verifying  : mysql-community-libs-8.0.28-1.el7.x86_64                                                                              5/6Verifying  : mysql-community-icu-data-files-8.0.28-1.el7.x86_64                                                                    6/6Installed:mysql-community-client.x86_64 0:8.0.28-1.el7                        mysql-community-server.x86_64 0:8.0.28-1.el7Dependency Installed:mysql-community-client-plugins.x86_64 0:8.0.28-1.el7                    mysql-community-common.x86_64 0:8.0.28-1.el7mysql-community-icu-data-files.x86_64 0:8.0.28-1.el7                    mysql-community-libs.x86_64 0:8.0.28-1.el7Complete!

5、启动mysql-community-server并查看运行状态:

[root@bjAli yum.repos.d]# systemctl start mysqld
[root@bjAli yum.repos.d]# systemctl status mysqld
● mysqld.service - MySQL ServerLoaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)Active: active (running) since Mon 2022-03-21 20:58:48 CST; 46s agoDocs: man:mysqld(8)http://dev.mysql.com/doc/refman/en/using-systemd.htmlProcess: 27026 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)Main PID: 27049 (mysqld)Status: "Server is operational"CGroup: /system.slice/mysqld.service└─27049 /usr/sbin/mysqldMar 21 20:58:46 bjAli systemd[1]: Starting MySQL Server...
Mar 21 20:58:48 bjAli systemd[1]: Started MySQL Server.
[root@bjAli yum.repos.d]#

6、查看初始密码并用本地客户端进行连接:

[root@bjAli yum.repos.d]# cat /var/log/mysqld.log | grep password
2022-03-20T13:32:46.555732Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: E)j2Q(B8%gbp  <== 初始密码
[root@bjAli yum.repos.d]# mysql -uroot -p
Enter password: <==输入查询到的初始密码后回车,连接成功
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.28Copyright (c) 2000, 2022, Oracle and/or its affiliates.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>

7、在使用数据库前,需要更改用户'root'@'localhost'初始密码,然后查看数据库的现有有效用户:

mysql> alter user 'root'@'localhost' identified by '@MYsql12345';
Query OK, 0 rows affected (0.01 sec)mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
mysql> select user,host from user;
+------------------+-----------+
| user             | host      |
+------------------+-----------+
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+
4 rows in set (0.00 sec)mysql>

8、退出本地数据库连接,然后用新设置的密码进程本地登录测试:

mysql> quit
Bye
[root@bjAli yum.repos.d]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.28 MySQL Community Server - GPLCopyright (c) 2000, 2022, Oracle and/or its affiliates.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>

9、创建一个可以远程登录的用户:

mysql>
mysql> create user 'dbuser'@'%' identified by '@MYsql12345'; % 创建一个可以远程登录的用户
Query OK, 0 rows affected (0.01 sec)mysql> show grants for 'dbuser'@'%';   # 显示新创建用户的权限
+------------------------------------+
| Grants for dbuser@%                |
+------------------------------------+
| GRANT USAGE ON *.* TO `dbuser`@`%` |
+------------------------------------+
1 row in set (0.00 sec)mysql> grant all privileges on *.* to 'dbuser'@'%';  # 对新创建用户进行授权
Query OK, 0 rows affected (0.01 sec)mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
mysql> select user,host from user;  # 查看新建用户是否存在
+------------------+-----------+
| user             | host      |
+------------------+-----------+
| dbuser           | %         |
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+
5 rows in set (0.00 sec)mysql>

10、测试远程连接:

1) 安装mysql官方软件:MySQL Workbench 8.0 CE

2) 启动软件:选择软件菜单栏Database->Connect to Database ...选项

3) 在弹出的窗口中填入数据库服务器的IP地址以及连接数据库所用的用户名:

4)在密码栏输入,为对应用户设置的密码:

5) 如果没有错误,则回显示以下一个sql语句编辑窗口:

6)按下图所示的1,2,3步骤进行操作,测试数据库查询,可以显示出查询结果为5个数据用户:

mysql8.0安装详解相关推荐

  1. windows10 安装 mysql8.0.12 详解

    [1]下载安装包 官网下载地址:https://downloads.mysql.com/archives/community/ 如下图所示: 下载完成,安装包为mysql-8.0.12-winx64. ...

  2. mysql安装mac 压缩包_MySQL8.0安装详解(图文版)

    点击关注 不迷路 MySQL8.0.22安装 MySQL8.0自2016年发布至今,已经更加的稳定和被大家接受,如今已经有很多公司放弃了5.7.x的版本,开始使用上了MySQL8.0. 大势所趋.本系 ...

  3. Windows下VTK6.0.0安装详解(CMake使用说明)

    操作系统:Windows7,用到工具:Visual studio.CMake. 1.准备工作 VTK下载: 下载最新VTK稳定版(6.0.0,截至2013年7月)http://www.vtk.org/ ...

  4. 【ESP32】1.Arduino IDE 2.0安装详解

    前言: 因为Arduino IDE 2.0 软件安装是没有包含ESP32需要的库文件的,所以这里的安装主要分两步 正文 1.Arduino IDE 2.0 软件安装 下载地址:Software | A ...

  5. QC学习一:Windows环境中Quality Center 9.0安装详解

    一.安装前准备 1.安装环境:windows XP.SQL Server2005 2.准备安装文件:Quality Center 9.0 (qc10以上,包括qc10,qc只支持安装在服务器操作系统上 ...

  6. 开源云计算平台 CloudStack 4.1.0 安装详解

    CloudStack是一个功能强大.UI友好的开源云(IaaS)计算解决方案.自Ctrix将CloudStack捐献给 apache 后,一直持续高速发展,其社区活跃度已经渐渐赶上风头一时无两的另一开 ...

  7. CloudStack 4.1.0 安装详解

    目录:[ - ] 一.前期准备 1.配置网卡,确保主机能上网 2.设置主机名称 3.配置时间同步 4.修改Linux安全设置 二.更新 yum 仓库 三.安装管理节点 四.配置数据库 五.登陆WEB- ...

  8. Zibbix3.0安装详解

    防伪码:真理不需色彩,美丽不需涂饰 一.监控概述: ·初级: ·1.识别监控对象         (分级) ·2.理解监控对象  (理论基础) ·3.细分监控对象的指标 ·4.确定告警的基准线 ·预中 ...

  9. 开源云平台 CloudStack 4.1.0 安装详解 - 3、vCenter

    为什么80%的码农都做不了架构师?>>>    VMware是世界上顶尖的提供虚拟化和云计算解决方案的商业公司,在全球拥有400,000多家客户和55,000多家合作伙伴.若干个产品 ...

最新文章

  1. oracle之TNS:无监听程序解决办法
  2. 思路拓展,如果是用2D的方式去做切割
  3. aix 的c库为什么都是静态库_关于AIX  libpthread.a 静态库
  4. 《操作系统》实验报告——进程调度的模拟
  5. Fast R-CNN论文详解 - CSDN博客
  6. QTP - 描述性编程
  7. Verilog inout语句使用方法及技巧
  8. .NET配置文件的原因、位置和方式
  9. Bzoj 4371: [IOI2015]sorting排序 二分
  10. AndroidStudio开发环境安装及配置
  11. cocos2dx 手游luac 解密 文件的key
  12. 如何在VSCode配置PHP开发环境(详细版)
  13. calcbusiness使用教程_Calc Business
  14. badboy安装及使用
  15. 以太网之父Bob Metcalfe荣获图灵奖,其同名定律成为互联网经济基石
  16. java邮件发送代码_用java代码发送邮件(优化版)
  17. 多标签文本分类研究进展概述
  18. 我与程思阳的2020
  19. 浙江大学计算机科学与技术学院分数线,浙江大学分数线是多少 王牌专业有哪些...
  20. thisis incompatible with sql_mode=only_full_group

热门文章

  1. 用数字 5,5,5,1 ,进行四则运算,每个数字当且仅当用一次,要求运算结果值为 24
  2. linux文件加密代码,OpenSSL 加密文件的完整实现代码
  3. C语言学习笔记 |进阶| 内存函数
  4. 条件式变换自编码机(conditional variational autoencoders)学习笔记(一)
  5. “无法删除数据库,因为该数据库当前正在使用“问题解决
  6. 谈IT大学生的竞争优势
  7. Android运行时权限一览表
  8. Android手机免root安装Linux+图形化
  9. DAM | 提升品牌自播引流能力的「幕后」推手 | 数字内容管理 引流营销资源
  10. Linux之 解决 Linux 性能瓶颈的黄金 60 秒