MySQL的三大版本

a)MySQL Enterprise Edition:企业版本(付费)
b)MySQL Cluster CGE:高级集群版(收费)
c)MySQL Community Server:社区版(开源)

登录MySQL官网

https://www.mysql.com/downloads/

点击“DOCUMENTATION”——“MySQL Server”——“Installing and Upgrading MySQL”——“Installing MySQL on Linux

点击:Installing MySQL on Linux Using the MySQL Yum Repository

点击:https://dev.mysql.com/downloads/repo/yum/

点击linux 7——download

右键复制链接地址

wget https://dev.mysql.com/get/mysql80-community-release-el7-7.noarch.rpm

操作步骤如下:

cd /opt/
wget https://dev.mysql.com/get/mysql80-community-release-el7-7.noarch.rpm
yum install mysql80-community-release-el7-7.noarch.rpm
gcc -v
yum update -y
yum list | grep mysql
yum install -y mysql-community-server root@jumpserver-app-t01:/opt#mysql -V
mysql Ver 8.0.32 for Linux on x86_64 (MySQL Community Server - GPL)

启动mysqld服务

root@jumpserver-app-t01:/opt/mysql#systemctl start mysqld
root@jumpserver-app-t01:/opt/mysql#systemctl status mysqld
root@jumpserver-app-t01:/opt/mysql#systemctl enable mysqld
root@jumpserver-app-t01:/opt/mysql#

找到mysql的默认密码在这里:root@localhost: si<%<s%x7.On

root@jumpserver-app-t01:/var/log#cat /var/log/mysqld.log
2023-02-21T11:06:14.287837Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.32) initializing of server in progress as process 90720
2023-02-21T11:06:14.296083Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-02-21T11:06:14.658319Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-02-21T11:06:15.848026Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: si<%<s%x7.On
2023-02-21T11:06:18.815307Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32) starting as process 90787
2023-02-21T11:06:18.821989Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-02-21T11:06:18.911013Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-02-21T11:06:19.119711Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-02-21T11:06:19.119756Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-02-21T11:06:19.136298Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2023-02-21T11:06:19.136335Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.32' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL.
root@jumpserver-app-t01:/var/log#

此时需要到mysql中使用临时密码登录,并修改临时密码,因为临时密码是不可用的

mysql -uroot -p
si<%<s%x7.On mysql> alter user root@'localhost' identified by'*******@666';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges; #刷新数据表信息后exit退出
Query OK, 0 rows affected (0.00 sec)
mysql>exit
Bye

分割线


PS:简单的MySQL安装方法,去阿里源中找到mysql-community-server-8.0.28-1.el7.x86_64.rpm,下载到本地后,然后yum localinstall ./*

这样既能安装该组件,还能安装所需依赖

cd /opt
mkdir mysql
cd mysql
wget https://mirrors.aliyun.com/mysql/MySQL-8.0/mysql-community-server-8.0.28-1.el7.x86_64.rpm?spm=a2c6h.25603864.0.0.5e8670b2c1XZn4
yum localinstall ./* 后面一路选Y安装即可 systemctl start mysqld
systemctl status mysqld
systemctl enable mysqld

分割线

1、创建JumpServer数据库,并存储为中文支持格式

root@jumpserver-app-t01.novalocal:/jumpserver/mysql_rpm#mysql -uroot -p
Enter password: mysql> create database jumpserver default charset 'utf8' collate 'utf8_bin';
Query OK, 1 row affected, 2 warnings (0.00 sec)
mysql>

2、创建用户 @是占位符、%是允许该账号在任何位置都可以登录

mysql> create user 'jumpserver'@'%' IDENTIFIED BY '******66666';
Query OK, 0 rows affected (0.00 sec) mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec) ###mysql登录报错时用这个命令
alter user jumpserver@'%' identified with mysql_native_password by '******66666';
###登录报错内容如下:
root@jumpserver-app-p01:/root#mysql -h 10.15.32.10 -P 3306 -u jumpserver -p
Enter password:
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

3、给JumpServer用户授予访问JumpServer数据库的权限。

#grant授权'jumpserver'@'%'用户在使用identified by 'chaoge888'密码时,允许访问jumpserver.*所有的表,的all privileges所有权限“添删改查”
mysql> grant all privileges on jumpserver.* to 'jumpserver'@'%' ;
Query OK, 0 rows affected (0.01 sec) mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec) mysql>exit
Bye

MySQL数据库基础常用命令8.0版本适用

#查询数据库账户
select user, host from mysql.user;
#删除账户 'zabbix'
drop user 'zabbix'@'%';
#查询数据库
show databases;
#删除数据库zabbix;
drop database zabbix;
#修改账户密码
alter user 'zabbix'@'%' identified by 'Qqqq1234.com';

ubuntu安装的mysql,默认配置文件保存在/etc/mysql/mysql.conf.d/mysqld.cnf

root@JumpServer-DB-P01:/opt# cat /etc/mysql/mysql.conf.d/mysqld.cnf
#
# The MySQL database server configuration file.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html # Here is entries for some specific programs
# The following values assume you have at least 32M ram [mysqld]
#
# * Basic Settings
#
user = mysql
# pid-file = /var/run/mysqld/mysqld.pid
# socket = /var/run/mysqld/mysqld.sock
# port = 3306
# datadir = /var/lib/mysql # If MySQL is running as a replication slave, this should be
# changed. Ref https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_tmpdir
# tmpdir = /tmp
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 0.0.0.0
mysqlx-bind-address = 0.0.0.0
#
# * Fine Tuning

部署堡垒机2——安装MySQL8.0.32或8.0.28+的更多相关文章

  1. jumpserver跳板机(堡垒机)安装

     jumpserver跳板机(堡垒机) Jumpserver 是一款由Python编写开源的跳板机(堡垒机)系统,实现了跳板机应有的功能,基于ssh协议来管理,客户端无需安装agent,助力互联网企业 ...

  2. 开源堡垒机Gateone 安装过程记录及报错处理

    1.下载git源码或者zip包都可以,下载到我们制定部署目录. git地址:https://github.com/liftoff/GateOne.git 2.检查tornado 版本,安装tornad ...

  3. Jumpserver(堡垒机)的安装与应用

    官网:http://docs.jumpserver.org/zh/docs/introduce.html 作者:邓聪聪 环境 系统: CentOS 7.6 IP: 172.16.16.2 关闭 sel ...

  4. day11 堡垒机

    项目实战:运维堡垒机开发 前景介绍 到目前为止,很多公司对堡垒机依然不太感冒,其实是没有充分认识到堡垒机在IT管理中的重要作用的,很多人觉得,堡垒机就是跳板机,其实这个认识是不全面的,跳板功能只是堡垒 ...

  5. python【第十三篇】可以写一个堡垒机了

    前景介绍 到目前为止,很多公司对堡垒机依然不太感冒,其实是没有充分认识到堡垒机在IT管理中的重要作用的,很多人觉得,堡垒机就是跳板机,其实这个认识是不全面的,跳板功能只是堡垒机所具备的功能属性中的其中 ...

  6. Python之路,Day12 - 那就做个堡垒机吧

    Python之路,Day12 - 那就做个堡垒机吧   本节内容 项目实战:运维堡垒机开发 前景介绍 到目前为止,很多公司对堡垒机依然不太感冒,其实是没有充分认识到堡垒机在IT管理中的重要作用的,很多 ...

  7. Day12 - 堡垒机开发

    Python之路,Day12 - 那就做个堡垒机吧   本节内容 项目实战:运维堡垒机开发 前景介绍 到目前为止,很多公司对堡垒机依然不太感冒,其实是没有充分认识到堡垒机在IT管理中的重要作用的,很多 ...

  8. Django项目:堡垒机(Linux服务器主机管理系统)--03--03堡垒机在Linux系统里记录会话日志02/02

    #main.py #本文件写所有的连接交互动作程序 # ————————————————03堡垒机在Linux系统里记录会话日志 开始———————————————— from Fortress im ...

  9. Django项目:堡垒机(Linux服务器主机管理系统)--02--02堡垒机设计后台交互程序

    #main.py #本文件写所有的连接交互动作程序 #————————————————02堡垒机设计后台交互程序 开始———————————————— from django.contrib.auth ...

  10. Python之堡垒机

    本节内容 项目实战:运维堡垒机开发 前景介绍 到目前为止,很多公司对堡垒机依然不太感冒,其实是没有充分认识到堡垒机在IT管理中的重要作用的,很多人觉得,堡垒机就是跳板机,其实这个认识是不全面的,跳板功 ...

随机推荐

  1. Building-Mobile-Apps-with-Ionic-2中文翻译工作

    最近没啥工作量, 然后学完了这本书, 接着又茫然找不到该干啥, 所以想着何不翻译这个书呢. 这本书首先给我们普及了Ionic 2的基础知识, Ionic 2和Ionic 1有本质上的区别, Ionic ...

  2. DHorse v1.4.0 发布,基于 k8s 的发布平台

    版本说明 新增特性 提供Fabric8客户端操作k8s(预览)的功能,可以通过指定-Dkubernetes-client=fabric8参数开启: Vue.React应用增加Pnpm.Yarn的构建方 ...

  3. Modbus转Profinet网关改写变频器运行状态在1200PLC程序控制实例

    兴达易控Modbus转Profinet网关将丹佛斯变频器接入西门子 1200PLC 配置案例 案例简介: 本案例是兴达易控Modbus转Profinet网关连接丹佛斯变频器在西门子 1200PLC程序 ...

  4. 12 款最棒 Vue 开源 UI 库

    文章目录 Element Plus - 经典中的经典,全面支持 Vue 3 TDesign Vue - 鹅厂优质 UI 组件,配套工具完满,设计工整,文档清晰 ArcoDesign Vue- 字节优质 ...

  5. ElasticSearch系列——文档操作

    文章目录 Elasticsearch的增删查改(CURD) 一 CURD之Create 二 CURD之Update 三 CURD之Delete 四 CURD之Retrieve Elasticsearc ...

  6. Update 1.82.1: The update addresses this security issue.

    August 2023 (version 1.82) 更新后显示发行说明 Update 1.82.1: The update addresses this security issue. Welcom ...

  7. 虹科分享 | B站崩了怎么办?Redis企业版数据库多云战略分析

    近日,拥有3.33亿月均活用户的中国最大青年社区-B站因大规模服务器宕机,再度喜提热搜.对于B站这样需要满足大量用户在同一时间进行访问并实现各种功能的大型平台,其后台架构是十分复杂和庞大的.本地服务器 ...

  8. Splay 详细图解 & 轻量级代码实现

    学 LCT 发现有点记不得 Splay 怎么写,又实在不知道这篇博客当时写了些什么东西(分段粘代码?),决定推倒重写. 好像高一学弟也在学平衡树,但相信大家都比樱雪喵强,都能一遍学会!/kel 写在前 ...

  9. k8s集群证书过期,重新生成证书

    Kubernetes集群证书过期后,使用kubeadm重新颁发证书 默认情况下部署kubernetes集群的证书一年内便过期,如果不及时升级证书导致证书过期,Kubernetes控制节点便会不可用,所 ...

  10. CSS单位px、em、rem及它们之间的换算关系

    作者:WangMin 格言:努力做好自己喜欢的每一件事 国内的设计师大都喜欢用px,而国外的网站大都喜欢用em和rem,那么三者的区别与优势是什么?接下来我们就来学习一下吧! 单位px.em.rem分 ...