当前位置:网站首页>在centos中安装mysql5.7.36
在centos中安装mysql5.7.36
2022-07-28 12:58:00 【Andy86666】
在centos中安装mysql5.7.36
在centos中安装mysql5.7.36
(一)、mysql-5.7.36-1.el7.x86_64.rpm-bundle.tar下载资源
mysql-5.7.36-1.el7.x86_64.rpm-bundle.tar
(二)、删除自带的数据库
sudo rpm -e --nodeps mariadb-libs
(三)、解压mysql-5.7.36-1.el7.x86_64.rpm-bundle.tar
tar -xf mysql-5.7.36-1.el7.x86_64.rpm-bundle.tar

(四)、安装mysql
注意:安装mysql,一定要注意先后顺序
sudo rpm -ivh mysql-community-common-5.7.36-1.el7.x86_64.rpm
sudo rpm -ivh mysql-community-libs-5.7.36-1.el7.x86_64.rpm
sudo rpm -ivh mysql-community-libs-compat-5.7.36-1.el7.x86_64.rpm
sudo rpm -ivh mysql-community-client-5.7.36-1.el7.x86_64.rpm
sudo rpm -ivh mysql-community-server-5.7.36-1.el7.x86_64.rpm

(五)、MySQL初始化
sudo mysqld --initialize --user=mysql

(六)、查看初始密码
在/etc/my.cnf 查看日志存放位置
cat /etc/my.cnf

查看日志文件中初始密码
cat /var/log/mysql.log

n:3Evf/(Sled
(七)登陆MySQL
先启动MySQL服务
sudo systemctl start mysqld
注意:只需要启动一次即可,下次开机自启
登陆MySQL
mysql -u root -p

修改密码
set password=password("root");

可以先退出试一下是否将密码修改成功
(八)将MySQL设置为任意ip可以访问
注意:目前MySQL只能是本地能够访问
相关的配置文件,在mysql中的mysql库的user表中

在user 字段中,root用户的host是localhost(本地)

解决办法:
update mysql.user set host="%" where user='root';
再输入下面命令,立刻生效
flush privileges;

可以测试一下是否可以远程访问MySQL
我们将windows中Navicat进行远程登录

边栏推荐
- Strict mode -- let and const -- arrow function -- Deconstruction assignment -- string template symbol -- set and map -- generator function
- R language uses LM function to build multiple linear regression model, writes regression equation according to model coefficient, and uses conflict function to give 95% confidence interval of regressi
- Thoroughly master binary search
- Merge table rows - three levels of for loop traversal data
- R语言ggplot2可视化:可视化散点图并为散点图中的数据点添加文本标签、使用ggrepel包的geom_text_repel函数避免数据点标签互相重叠(自定义指定字体类型font family)
- 掌握闭包,夯实基本功
- UVA1599理想路径题解
- Leetcode depth first and breadth first traversal
- a标签_文件下载(download属性)
- Operator3-设计一个operator
猜你喜欢

Strict mode -- let and const -- arrow function -- Deconstruction assignment -- string template symbol -- set and map -- generator function

Security assurance is based on software life cycle -psp application

安全保障基于软件全生命周期-Istio的认证机制

Children's programming electronic society graphical programming level examination scratch Level 2 real problem analysis (judgment question) June 2022

30 day question brushing plan (III)

Socket class understanding and learning about TCP character stream programming

Org.apache.ibatis.exceptions.toomanyresultsexception

Cool operation preheating! Code to achieve small planet effect

Deploy application delivery services in kubernetes (Part 1)

Understanding of "image denoising using an improved generic advantageous network with Wasserstein distance"
随机推荐
On websocket
The domestic API management tool eolink is very easy to use, creating an efficient research and development tool
R language ggplot2 visualization: use ggviolin function of ggpubr package to visualize violin diagram and set draw_ The quantiles parameter adds a specified quantile horizontal line (for example, 50%
基于NoneBot2的qq机器人配置记录
记一次使用pdfbox解析pdf,获取pdf的关键数据的工具使用
面经整理,助力秋招,祝你称为offer收割机
Merge table rows - three levels of for loop traversal data
URL related knowledge points
TS扫盲大法-基础篇
图的遍历(BFS&&DFS基础)
R语言可视化散点图、使用ggrepel包的geom_text_repel函数避免数据点之间的标签互相重叠(使用参数xlim和ylim将标签添加到可视化图像的特定区域、指定标签线段并添加箭头)
No swagger, what do I use?
【安全】 阅读 RFC6749 及理解 Oauth2.0 下的授权码模式
Intersectionobserver
Qt5开发从入门到精通——第一篇概述
Excellent performance! Oxford, Shanghai, AI Lab, Hong Kong University, Shangtang, and Tsinghua have joined forces to propose a language aware visual transformer for reference image segmentation! Open
Deploy application delivery services in kubernetes (Part 1)
UVA11175有向图D和E From D to E and Back题解
DXF reading and writing: Chinese description of dimension style group codes
盘点操作URL中常用的几个高效API