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

边栏推荐
- Tutorial on the principle and application of database system (060) -- MySQL exercise: operation questions 11-20 (IV)
- 盘点操作URL中常用的几个高效API
- 【安全】 阅读 RFC6749 及理解 Oauth2.0 下的授权码模式
- POJ3275 Ranking the Cows题解
- P1797重型运输 题解
- UVA11175有向图D和E From D to E and Back题解
- 《机器学习》(周志华) 第6章 支持向量 学习心得 笔记
- Countdown 2 days! 2022 China Computing Conference: Mobile cloud invites you to meet with computing network for innovative development
- 图的遍历(BFS&&DFS基础)
- Qt5 development from introduction to mastery -- the first overview
猜你喜欢

Product Manager: job responsibility table

严格模式——let和const——箭头函数——解构赋值——字符串模板symbol——Set和Map——生成器函数
![[basic course of flight control development 7] crazy shell · open source formation UAV SPI (barometer data acquisition)](/img/ad/e0bc488c238a260768f7e7faec87d0.png)
[basic course of flight control development 7] crazy shell · open source formation UAV SPI (barometer data acquisition)

Understanding of "image denoising using an improved generic advantageous network with Wasserstein distance"

Record a fake login of cookie

What is the reason why the words behind word disappear when typing? How to solve it?

DDoS protection with iptables

Istio四之故障注入和链路追踪

最强分布式锁工具:Redisson

How to check if the interface cannot be adjusted? I didn't expect that the old bird of the 10-year test was planted on this interview question
随机推荐
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
【飞控开发基础教程7】疯壳·开源编队无人机-SPI(气压计数据获取)
关于栈的理解以及实际应用场景
R语言使用lm函数构建多元回归模型(Multiple Linear Regression)、并根据模型系数写出回归方程、使用confint函数给出回归系数的95%置信区间
A label_ File download (download attribute)
Holes in [apue] files
Istio IV fault injection and link tracking
R语言因子数据的表格和列联表(交叉表)生成:使用summay函数分析列表查看卡方检验结果判断两个因子变量是否独立(使用卡方检验验证独立性)
多线程与高并发(三)—— 源码解析 AQS 原理
How to check if the interface cannot be adjusted? I didn't expect that the old bird of the 10-year test was planted on this interview question
vite在项目中配置路径别名
30天刷题计划(二)
TS扫盲大法-基础篇
DXF读写:对齐尺寸标注文字居中、上方的位置计算
Org.apache.ibatis.exceptions.toomanyresultsexception
Poj3275 ranking the cows
IntersectionObserver交叉观察器
Tutorial on the principle and application of database system (060) -- MySQL exercise: operation questions 11-20 (IV)
Countdown 2 days! 2022 China Computing Conference: Mobile cloud invites you to meet with computing network for innovative development
How to play a data mining game entry Edition