当前位置:网站首页>在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进行远程登录

边栏推荐
- [basic course of flight control development 7] crazy shell · open source formation UAV SPI (barometer data acquisition)
- P1797重型运输 题解
- vite在项目中配置路径别名
- R语言ggplot2可视化:使用ggpubr包的ggviolin函数可视化小提琴图、设置draw_quantiles参数添加指定分位数横线(例如,50%分位数、中位数)
- R语言ggplot2可视化:使用ggpubr包的ggviolin函数可视化小提琴图、设置palette参数自定义不同水平小提琴图的边框颜色
- 要想组建敏捷团队,这些方法不可少
- 图的遍历(BFS&&DFS基础)
- Cool operation preheating! Code to achieve small planet effect
- Several efficient APIs commonly used in inventory operation URL
- R language test sample proportion: use prop The test function performs the single sample proportion test to calculate the confidence interval of the p value of the successful sample proportion in the
猜你喜欢

不用Swagger,那我用啥?

Qt5开发从入门到精通——第一篇概述

【LVGL事件(Events)】事件在不同组件上的应用(一)

对“Image Denoising Using an Improved Generative Adversarial Network with Wasserstein Distance“的理解

The domestic API management tool eolink is very easy to use, creating an efficient research and development tool

拒绝服务 DDoS 攻击

国产API管理工具Eolink太好用了,打造高效的研发利器

How to play a data mining game entry Edition

30天刷题计划(二)

【飞控开发基础教程7】疯壳·开源编队无人机-SPI(气压计数据获取)
随机推荐
安全保障基于软件全生命周期-Istio的认证机制
DXF读写:对齐尺寸标注文字居中、上方的位置计算
Qt5开发从入门到精通——第一篇概述
Continuous (integration -- & gt; delivery -- & gt; deployment)
R language ggplot2 visualization: visualize the scatter diagram and add text labels to the data points in the scatter diagram, using geom of ggrep package_ text_ The rep function avoids overlapping da
UVA11175有向图D和E From D to E and Back题解
Org.apache.ibatis.exceptions.toomanyresultsexception
产品经理:岗位职责表
POJ1860货币兑换题解
Intersectionobserver
DOJNOIP201708奶酪题解
word打字时后面的字会消失是什么原因?如何解决?
Tutorial on the principle and application of database system (060) -- MySQL exercise: operation questions 11-20 (IV)
使用 Fail2ban 保护 Web 服务器免受 DDoS 攻击
30天刷题计划(三)
拒绝服务 DDoS 攻击
了解BFC特性,轻松实现自适应布局
R language uses LM function to build linear regression model and subset function to specify subset of data set to build regression model (use floor function and length function to select the former pa
POJ3259虫洞题解
es6你用过哪些惊艳的写法