python_PyQt5日周月K线纵向对齐显示_3_聚焦某段图形

目录

写在前面:

结果显示:

代码:


写在前面:

“PyQt5日周月K线纵向对齐显示”,将分三篇博文描述

1 数据处理。将数据处理成适合图形显示的格式。(已写,请看往期博文)

2 显示工具开发。用pyqtgraph开发。(已写,请看往期博文)

3 聚焦某段图形

结果显示:

选择2023年1月5日聚焦,图形会将2023年1月5日的数据移到中心位置,并放大显示

代码:

聚焦的代码 在 def focus_location(self,left_x:int,right_x:int,y_data:List)中,计算要聚焦数据要显示的横坐标范围和纵坐标范围,在ViewBox中重绘

整体代码

import sys
import pandas as pd
import talib
from typing import Dict,List
from PyQt5 import QtCore,QtWidgets,QtGui
import pyqtgraph as pg
pg.setConfigOption('background','w')
pg.setConfigOption('foreground','k')class CandlestickItem(pg.GraphicsObject):def __init__(self, data):pg.GraphicsObject.__init__(self)self.data = data  ## data must have fields: time, open, close, min, maxself.generatePicture()def generatePicture(self):## pre-computing a QPicture object allows paint() to run much more quickly,## rather than re-drawing the shapes every time.self.picture = QtGui.QPicture()p = QtGui.QPainter(self.picture)p.setPen(pg.mkPen('d'))# w = (self.data[1][0] - self.data[0][0]) / 3.w = 0.3for (t, open, close, min, max) in self.data:p.drawLine(QtCore.QPointF(t, min), QtCore.QPointF(t, max))if open < close:p.setBrush(pg.mkBrush('r'))else:p.setBrush(pg.mkBrush('g'))p.drawRect(QtCore.QRectF(t-w, open, w * 2, close - open))p.end()def paint(self, p, *args):p.drawPicture(0, 0, self.picture)def boundingRect(self):## boundingRect _must_ indicate the entire area that will be drawn on## or else we will get artifacts and possibly crashing.## (in this case, QPicture does all the work of computing the bouning rect for us)return QtCore.QRectF(self.picture.boundingRect())class VOLtickItem(pg.GraphicsObject):def __init__(self, data):pg.GraphicsObject.__init__(self)self.data = data  ## data must have fields: time,open,close, volself.generatePicture()def generatePicture(self):self.picture = QtGui.QPicture()p = QtGui.QPainter(self.picture)p.setPen(pg.mkPen('d'))# w = (self.data[1][0] - self.data[0][0]) / 3.w = 0.3for (t,open,close, vol) in self.data:if open < close:p.setBrush(pg.mkBrush('r'))else:p.setBrush(pg.mkBrush('g'))p.drawRect(QtCore.QRectF(t - w, 0, w * 2, vol))p.end()def paint(self, p, *args):p.drawPicture(0, 0, self.picture)def boundingRect(self):## boundingRect _must_ indicate the entire area that will be drawn on## or else we will get artifacts and possibly crashing.## (in this case, QPicture does all the work of computing the bouning rect for us)return QtCore.QRectF(self.picture.boundingRect())class ExampleWidget(QtWidgets.QWidget):def __init__(self):super().__init__()self.init_data()self.init_ui()passdef init_data(self):self.v_list = []self.vline_list = []self.hline_list = []self.label_list = []self.data_list = []self.show_map: Dict = {}self.mark_data_map: Dict = {}self.mark_item_map: Dict = {}self.hand_check_data: Dict = {}self.three_df = Noneself.graph_type_candle: str = 'candle'self.graph_type_curve: str = 'curve'self.graph_type_bar: str = 'bar'self.tip_show_yeah: bool = Falsepassdef init_ui(self):self.setMinimumWidth(800)self.setMinimumHeight(600)origin_btn = QtWidgets.QPushButton('返回原位')origin_btn.clicked.connect(self.origin_btn_clicked)self.tip_checkbox = QtWidgets.QCheckBox('数据提示框')self.tip_checkbox.stateChanged.connect(self.tip_checkbox_stateChanged)self.focus_point = QtWidgets.QDateEdit()self.focus_point.setDisplayFormat('yyyy-MM-dd')self.focus_point.setCalendarPopup(True)focus_check_btn = QtWidgets.QPushButton('聚焦')focus_check_btn.clicked.connect(self.focus_check_btn_clicked)layout1 = QtWidgets.QHBoxLayout()layout1.addWidget(origin_btn)layout1.addWidget(self.tip_checkbox)layout1.addStretch(1)layout1.addWidget(self.focus_point)layout1.addWidget(focus_check_btn)self.pw_layout = QtWidgets.QVBoxLayout()self.scroll_area = QtWidgets.QScrollArea()self.scroll_area.setWidgetResizable(True)self.scroll_area.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)self.scroll_area.setViewportMargins(20,20,20,20)layout = QtWidgets.QVBoxLayout()layout.addLayout(layout1)layout.addWidget(self.scroll_area)self.setLayout(layout)passdef focus_location(self,left_x:int,right_x:int,y_data:List):if self.v_list:v0 = self.v_list[0]v0.setXRange(min=left_x,max=right_x)for i,v in enumerate(self.v_list):y_node = y_data[i]v.setYRange(min=y_node[0],max=y_node[1])passdef restart_init(self):self.v_list.clear()self.vline_list.clear()self.hline_list.clear()self.label_list.clear()self.data_list.clear()self.show_map.clear()passdef origin_btn_clicked(self):if self.v_list:v0 = self.v_list[0]v0.enableAutoRange() # 还原到初始状态passdef tip_checkbox_stateChanged(self):if self.tip_checkbox.isChecked():self.tip_show_yeah = Trueelse:self.tip_show_yeah = Falsepassdef focus_check_btn_clicked(self):focus_date_str = self.focus_point.date().toString('yyyy-MM-dd')cur_i = self.hand_check_data[focus_date_str]y_data = self.caculate_focus_location_data(cur_i-10, cur_i+10)self.focus_location(cur_i-10, cur_i+10, y_data)passdef caculate_focus_location_data(self,left_x:int,right_x:int)->List:# 返回每个视图的y数据 日 周 月three_df = self.three_df.copy()node_df = three_df.loc[(three_df['row_i']>=left_x) & (three_df['row_i']<=right_x)].copy()day_y_min = node_df['lowestPrice'].min()day_y_max = node_df['highestPrice'].max()day_v_min = 0day_v_max = node_df['turnoverVol'].max()week_y_min = node_df['week_low'].min()week_y_max = node_df['week_high'].max()week_v_min = 0week_v_max = node_df['week_turnoverVol'].max()month_y_min = node_df['month_low'].min()month_y_max = node_df['month_high'].max()month_v_min = 0month_v_max = node_df['month_turnoverVol'].max()return [[day_y_min,day_y_max],[day_v_min,day_v_max],[week_y_min,week_y_max],[week_v_min,week_v_max],[month_y_min,month_y_max],[month_v_min,month_v_max]]def set_data(self,data:Dict):self.restart_init()self.show_map = data['show_map']self.data_list = data['data_list']self.hand_check_data = data['hand_check_data']self.three_df = data['three_df']self.fill_viewbox()passdef fill_viewbox(self):pw = pg.GraphicsLayoutWidget(show=False)h_i = 0for i,node in enumerate(self.data_list):'''height_numdata_list:[{type:candle,curve,bardata:[]},{}]'''v = pw.addViewBox(row=i, col=0)v.setMouseEnabled(x=True, y=False)v.setAutoVisible(x=False, y=True)height_num = node['height_num']node_yMin = node['yMin']node_yMax = node['yMax']pw.ci.layout.setRowMinimumHeight(i, height_num)v.setLimits(yMin=node_yMin, yMax=node_yMax)h_i += height_numif i>0:v.setXLink(self.v_list[0])node_data_list = node['data_list']for one in node_data_list:one_type = one['type']one_data = one['data']if one_type == self.graph_type_candle:candle = CandlestickItem(one_data)v.addItem(candle)elif one_type == self.graph_type_curve:curve = pg.PlotCurveItem(x=one_data['x'],y=one_data['y'],pen=(0,0,255))v.addItem(curve)passelif one_type == self.graph_type_bar:bar = VOLtickItem(one_data)v.addItem(bar)passelse:passpassvLine = pg.InfiniteLine(angle=90, movable=False)hLine = pg.InfiniteLine(angle=0, movable=False)label = pg.TextItem()v.addItem(vLine, ignoreBounds=True)v.addItem(hLine, ignoreBounds=True)v.addItem(label, ignoreBounds=True)v.scene().sigMouseMoved.connect(self.mouseMoved)self.v_list.append(v)self.vline_list.append(vLine)self.hline_list.append(hLine)self.label_list.append(label)passpw.setFixedHeight(h_i+50)self.fill_pw_widget(pw)passdef fill_pw_widget(self,pw):# print(pw.width(),pw.height())# 清空控件while self.pw_layout.count():item = self.pw_layout.takeAt(0)widget = item.widget()if widget is not None:widget.deleteLater()passsc_child_widget = self.scroll_area.takeWidget()if sc_child_widget is not None:sc_child_widget.deleteLater()# for item in self.pw_widgets_list:#     self.pw_layout.addWidget(item)self.pw_layout.addWidget(pw)one_sc_child_widget = QtWidgets.QWidget()one_sc_child_widget.setLayout(self.pw_layout)self.scroll_area.setWidget(one_sc_child_widget)passdef mouseMoved(self,evt):pos = evtfor la in self.label_list:la.setHtml("")la.setPos(-1, -1)for i,v in enumerate(self.v_list):if v.sceneBoundingRect().contains(pos):mousePoint = v.mapSceneToView(pos)index = int(mousePoint.x())hline = self.hline_list[i]hline.setPos(mousePoint.y())for hi,hl in enumerate(self.hline_list):if hi!=i:hl.setPos(-1)passfor vl in self.vline_list:vl.setPos(mousePoint.x())if self.tip_show_yeah and self.show_map.get(str(index)):node_one = self.show_map[str(index)]node_str = "<span style='font-size:12pt;color:red'>"n_i = 1for k,v in node_one.items():if n_i%7 == 0:node_str += f"{k}:{v}<br/>"else:node_str += f"{k}:{v}&nbsp;"n_i += 1passnode_str += "</span>"tip_label = self.label_list[i]tip_label.setHtml(node_str)tip_label.setPos(mousePoint.x(),mousePoint.y())passelse:for la in self.label_list:la.setHtml("")la.setPos(-1,-1)passbreakpasspasspassdef temp_000():junxian = 20columns_list = ['row_i', 'tradeDate', 'openPrice', 'highestPrice', 'lowestPrice', 'closePrice','turnoverVol', 'turnoverValue','ma','vol_ma','value_ma']file_path = r'E:/temp003/600941.xlsx'df = pd.read_excel(file_path,engine='openpyxl')df['row_i'] = [i for i in range(len(df))]df['o_date'] = pd.to_datetime(df['tradeDate'])df['ma'] = talib.MA(df['closePrice'], timeperiod=junxian)df['vol_ma'] = talib.MA(df['turnoverVol'], timeperiod=junxian)df['value_ma'] = talib.MA(df['turnoverValue'], timeperiod=junxian)week_group = df.resample('W-FRI', on='o_date')month_group = df.resample('M', on='o_date')week_df = week_group.last()week_df['row_i'] = week_group.last()['row_i']week_df['openPrice'] = week_group.first()['openPrice']week_df['lowestPrice'] = week_group.min()['lowestPrice']week_df['highestPrice'] = week_group.max()['highestPrice']week_df['turnoverVol'] = week_group.sum()['turnoverVol']week_df['turnoverValue'] = week_group.sum()['turnoverValue']week_df = week_df.loc[:, columns_list].copy()week_df.dropna(axis=0, how='any', subset=['closePrice'], inplace=True)week_df['ma'] = talib.MA(week_df['closePrice'], timeperiod=junxian)week_df['vol_ma'] = talib.MA(week_df['turnoverVol'], timeperiod=junxian)week_df['value_ma'] = talib.MA(week_df['turnoverValue'], timeperiod=junxian)month_df = month_group.last()month_df['row_i'] = month_group.last()['row_i']month_df['openPrice'] = month_group.first()['openPrice']month_df['lowestPrice'] = month_group.min()['lowestPrice']month_df['highestPrice'] = month_group.max()['highestPrice']month_df['turnoverVol'] = month_group.sum()['turnoverVol']month_df['turnoverValue'] = month_group.sum()['turnoverValue']month_df = month_df.loc[:, columns_list].copy()month_df.dropna(axis=0, how='any', subset=['closePrice'], inplace=True)month_df['ma'] = talib.MA(month_df['closePrice'], timeperiod=junxian)month_df['vol_ma'] = talib.MA(month_df['turnoverVol'], timeperiod=junxian)month_df['value_ma'] = talib.MA(month_df['turnoverValue'], timeperiod=junxian)daily_df = df.loc[:, columns_list].copy()return daily_df, week_df, month_df# daily_df.to_excel(r'E:/temp009/day.xlsx',engine='openpyxl')# week_df.to_excel(r'E:/temp009/week.xlsx',engine='openpyxl')# month_df.to_excel(r'E:/temp009/month.xlsx',engine='openpyxl')return daily_df,week_df,month_dfdef temp_001(daily_df,week_df,month_df):week_df.rename(columns={'row_i': 'week_i', 'tradeDate': 'week_tradeDate', 'closePrice': 'week_close', 'openPrice': 'week_open','lowestPrice': 'week_low', 'highestPrice': 'week_high', 'turnoverVol': 'week_turnoverVol','turnoverValue': 'week_turnoverValue'}, inplace=True)month_df.rename(columns={'row_i': 'month_i', 'tradeDate': 'month_tradeDate', 'closePrice': 'month_close','openPrice': 'month_open', 'lowestPrice': 'month_low', 'highestPrice': 'month_high','turnoverVol': 'month_turnoverVol', 'turnoverValue': 'month_turnoverValue'}, inplace=True)three_df = pd.merge(daily_df, week_df, how='left', left_on='tradeDate', right_on='week_tradeDate')three_df.fillna(method='bfill', inplace=True)three_df = pd.merge(three_df, month_df, how='left', left_on='tradeDate', right_on='month_tradeDate')three_df.fillna(method='bfill', inplace=True)# three_df.to_excel(r'E:/temp009/111/three.xlsx',engine='openpyxl')res_map = {}for i, row in three_df.iterrows():row_i = row['row_i']res_map[str(row_i)] = {'日期': row['tradeDate'],'收盘价': row['closePrice'],'开盘价': row['openPrice'],'最高价': row['highestPrice'],'最低价': row['lowestPrice'],'成交量': row['turnoverVol'],'成交额': row['turnoverValue'],'周': row['week_tradeDate'],'周收盘价': row['week_close'],'周开盘价': row['week_open'],'周最高价': row['week_high'],'周最低价': row['week_low'],'周成交量': row['week_turnoverVol'],'周成交额': row['week_turnoverValue'],'月': row['month_tradeDate'],'月收盘价': row['month_close'],'月开盘价': row['month_open'],'月最高价': row['month_high'],'月最低价': row['month_low'],'月成交量': row['month_turnoverVol'],'月成交额': row['month_turnoverValue']}return res_map, three_dfdef temp_002(df):# 生成K线图和成交量柱状图k_height_num = 400vol_height_num = 100candle_data = df.loc[:, ['row_i', 'openPrice', 'closePrice', 'lowestPrice', 'highestPrice']].values.tolist()curve_data = {'x': df['row_i'].values.tolist(),'y': df['ma'].values.tolist()}one = {'height_num': k_height_num,'yMin': df['lowestPrice'].min(),'yMax': df['highestPrice'].max(),'data_list': [{'type': 'candle','data': candle_data},{'type': 'curve','data': curve_data}]}bar_data = df.loc[:, ['row_i', 'openPrice', 'closePrice', 'turnoverVol']].values.tolist()curve_data2 = {'x': df['row_i'].values.tolist(),'y': df['vol_ma'].values.tolist()}two = {'height_num': vol_height_num,'yMin': 0,'yMax': df['turnoverVol'].max(),'data_list': [{'type': 'bar','data': bar_data},{'type': 'curve','data': curve_data2}]}return one, twoif __name__ == '__main__':QtCore.QCoreApplication.setAttribute(QtCore.Qt.HighDpiScaleFactorRoundingPolicy.PassThrough)app = QtWidgets.QApplication(sys.argv)main_window = ExampleWidget()# main_window.show()# app.exec()day_df,week_df,month_df = temp_000()k_tip_map, three_df = temp_001(day_df.copy(),week_df.copy(),month_df.copy())one,two = temp_002(day_df.copy())three,four = temp_002(week_df.copy())five,six = temp_002(month_df.copy())hand_check_data = {}for i,row in day_df.iterrows():hand_check_data[row['tradeDate']] = row['row_i']base_k_data = {'show_map': k_tip_map,'data_list': [one, two, three, four, five, six],'hand_check_data':hand_check_data,'three_df':three_df}main_window.set_data(base_k_data)main_window.show()app.exec()pass

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/124509.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

不小心commit错误代码,还没push的回滚解决方法

命令&#xff1a;git reset --soft HEAD^ 第一步&#xff1a;找到项目所在文件夹 第二步&#xff0c;右键点击git base here 第三步&#xff0c;命令行输入git reset --soft HEAD^ 回车即可

【斗破年番】暗杀行动开始,萧炎斩杀负伤,彩鳞心疼霸气回击

【侵权联系删除】【文/郑尔巴金】 深度爆料&#xff0c;《斗破苍穹》年番第69集刚刚更新了&#xff01;在这集剧情中&#xff0c;萧炎和美杜莎筹划了一场暗杀行动&#xff0c;以保障炎盟的安全。他们根据小医仙提供的地图&#xff0c;分别负责击杀慕兰三老和雁落天这两位敌方强…

sql-50练习题0-5

sql练习题0-5题 前言数据库表结构介绍学生表课程表成绩表教师表 0-1 查询"01"课程比"02"课程成绩高的学生的信息及课程分数0-2查询"01"课程比"02"课程成绩小的学生的信息及课程分数0-3查询平均成绩大于等于60分的同学的学生编号和学生…

C语言 每日一题 PTA 10.30 day8

1.高空坠球 皮球从某给定高度自由落下&#xff0c;触地后反弹到原高度的一半&#xff0c;再落下&#xff0c;再反弹&#xff0c;……&#xff0c;如此反复。问皮球在第n次落地时&#xff0c;在空中一共经过多少距离&#xff1f;第n次反弹的高度是多少&#xff1f; 输入格式 : …

Element 多个Form表单 同时验证

一、背景 在一个页面中需要实现两个Form表单&#xff0c;并在页面提交时需要对两个Form表单进行校验&#xff0c;两个表单都校验成功时才能提交 所用技术栈&#xff1a;Vue2Element UI 二、实现效果 三、多个表单验证 注意项&#xff1a; 两个form表单&#xff0c;每个表单上…

R语言与作物模型(以DSSAT模型为例)融合应用

随着基于过程的作物生长模型&#xff08;Process-based Crop Growth Simulation Model&#xff09;的发展&#xff0c;R语言在作物生长模型和数据分析、挖掘和可视化中发挥着越来越重要的作用。想要成为一名优秀的作物模型使用者与科研团队不可或缺的人才&#xff0c;除了掌握对…

秒级启动的集成测试框架

本文介绍了一种秒级启动的集成测试框架&#xff0c;使用该框架可以方便的修改和完善测试用例&#xff0c;使得测试用例成为测试过程的产物。 背景 传统的单元测试&#xff0c;测试的范围往往非常有限&#xff0c;常常覆盖的是一些工具类、静态方法或者较为底层纯粹的类实现&…

PostMan 之 Mock 接口测试

在测试的时候经常会碰到后端开发工程师的接口还没有开发完成&#xff0c;但是测试任务已经分配过来。没有接口怎么测试呢&#xff1f; 测试人员可以通过 mock server 自己去造一个接口来访问。mock server 可用于模拟真实的接口。收到请求时&#xff0c;它会根据配置返回对应的…

桶装水送水多门店水票押金押桶小程序开发

桶装水送水多门店水票押金押桶小程序开发 用户注册和登录首页展示各门店的桶装水品牌和价格用户可以选择门店和水品牌&#xff0c;并下单购买桶装水用户可以选择送水时间和地址用户可以查看自己的订单历史和当前订单状态用户可以申请退款或修改订单信息门店可以登录后台管理系…

ORACLE运行的数据库突然连接报“无监听程序”

远程&#xff1a;用远程的数据库连接工具用localhost可以连接&#xff0c;用ip地址除127.0.0.1不可连接。 可能是日志文件满了&#xff0c;解决办法如下&#xff1a; 第一步&#xff1a;关闭数据库监听程序【任务管理器--》服务--》右键停止服务】 第二步&#xff1a;找到日志…

AR眼镜安卓主板,智能眼镜光机方案定制

AR智能眼镜是一项涉及广泛技术的创新产品&#xff0c;它需要考虑到光学、显示、功耗、散热、延迟、重量以及佩戴人体工学等多个方面的因素&#xff0c;每一个项目都是技术进步所需攻克的难题。 在本文中&#xff0c;我们将重点讨论AR眼镜的主板和光学方案。 首先是AR智能眼镜的…

【C++的OpenCV】第十四课-OpenCV基础强化(二):访问单通道Mat中的值之at()、ptr()、iscontinuous()

&#x1f389;&#x1f389;&#x1f389; 欢 迎 各 位 来 到 小 白 p i a o 的 学 习 空 间 &#xff01; \color{red}{欢迎各位来到小白piao的学习空间&#xff01;} 欢迎各位来到小白piao的学习空间&#xff01;&#x1f389;&#x1f389;&#x1f389; &#x1f496;&…

Netty复习:(2)IdleStateHandler的用法

一、handler定义&#xff1a; package handler;import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter;public class MyChatServerHandler3 extends ChannelInboundHandlerAdapter {Overridepublic void userEventTriggered(…

UTC时间戳与北京时间转换

文章目录 前言一、几个时间相关的概念二、场景三、验证方法四、源码五、运行结果六、资源自取 前言 在应用中用到了 UTC 时间戳与北京时间进行转换的需求&#xff0c;这里做一个记录&#xff0c;方便后面有需求时直接拿来用。 一、几个时间相关的概念 GMT 时间&#xff1a;Gr…

SpringBoot内置工具类之断言Assert的使用与部分解析

2023.10.29更新&#xff1a; 使用assert的不利之处&#xff1a; 1、assert关键字需要在运行时候显式开启才能生效&#xff0c;否则你的断言就没有任何意义。而现在主流的Java IDE工具默认都没有开启-ea断言检查功能。这就意味着你如果使用IDE工具编码&#xff0c;调试运行时候…

ASP.NET WebApi 极简依赖注入

文章目录 环境服务类启动项注入使用依赖注入的优点 环境 .NET Core 7.0ASP.NET CoreVisual Studio 2022 服务类 public class T_TempService {public T_TempService(){}public void Test(){}}启动项注入 #region 依赖注入 builder.Services.AddTransient<T_TempService&g…

滑动窗口限流算法实现一

固定算法 原理&#xff1a;固定算法是将时间线分隔成固定大小的时间窗口&#xff0c;每个窗口都会有个计数器&#xff0c;用来记录窗口时间范围内的请求总数&#xff0c;如果窗口的请求总数达到最大限定值&#xff0c;会认定流量超限。比如将窗口大小设为1分钟&#xff0c;每分…

科大讯飞勾勒生成式AI输入法“模样”,开启下一代输入法革命

回顾国内第三方输入法赛道近十余年的发展&#xff0c;移动互联网的市场红利催生了科大讯飞、百度、搜狗等颇具规模和实力的头部厂商。与此同时&#xff0c;历经多年、多方角逐&#xff0c;第三方输入法市场进入存量阶段&#xff0c;升级技术、优化用户体验来挖掘存量&#xff0…

Rest风格基本语法与实战

1&#xff0c;前置知识点 1.1 GetMapping&#xff0c;PostMapping&#xff0c;PutMapping&#xff0c;DeleteMapping 平时我们都是使用RequestMapping&#xff0c;然后通过它的method属性来指定请求的方式&#xff0c;这样是有些麻烦的&#xff0c;然后这四个标签就是来简化这…

MySQL安装『适用于 CentOS 7』

✨个人主页&#xff1a; 北 海 &#x1f389;所属专栏&#xff1a; MySQL 学习 &#x1f383;操作环境&#xff1a; CentOS 7.6 腾讯云远程服务器 &#x1f381;软件版本&#xff1a; MySQL 5.7.44 文章目录 1.MySQL 的清理与安装1.1查看是否存在 MySQL 服务1.2.卸载原有服务1.…