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

边栏推荐
- Chapter 6 support vector machine
- P1797重型运输 题解
- 30 day question brushing plan (III)
- 记一次COOKIE的伪造登录
- R language uses dpois function to generate Poisson distribution density data and plot function to visualize Poisson distribution density data
- 使用 IPtables 进行 DDoS 保护
- 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
- No swagger, what do I use?
- Dojp1520 gate jumping problem solution
- Tutorial on the principle and application of database system (061) -- MySQL exercise: operation questions 21-31 (V)
猜你喜欢

Security assurance is based on software life cycle -psp application

【安全】 阅读 RFC6749 及理解 Oauth2.0 下的授权码模式

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

DXF reading and writing: align the calculation of the position of the dimension text in the middle and above

Better and more modern terminal tools than xshell!

The strongest distributed locking tool: redisson

word打字时后面的字会消失是什么原因?如何解决?

国产API管理工具Eolink太好用了,打造高效的研发利器
JWT login authentication + token automatic renewal scheme, well written!

不用Swagger,那我用啥?
随机推荐
Children's programming electronic society graphical programming level examination scratch Level 2 real problem analysis (judgment question) June 2022
Operator3-设计一个operator
Security assurance is based on software life cycle - networkpolicy application
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
安全保障基于软件全生命周期-Istio的认证机制
R语言检验样本比例:使用prop.test函数执行单样本比例检验计算总体中成功样本比例p值的置信区间(设置conf.level参数指定置信水平、置信区间的大小)
ES6 what amazing writing methods have you used
How to play a data mining game entry Edition
R语言使用dpois函数生成泊松分布密度数据、使用plot函数可视化泊松分布密度数据(Poisson distribution)
JWT 登录认证 + Token 自动续期方案,写得太好了!
Cool operation preheating! Code to achieve small planet effect
Do you really know esmodule
Tutorial on the principle and application of database system (061) -- MySQL exercise: operation questions 21-31 (V)
R语言因子数据的表格和列联表(交叉表)生成:使用summay函数分析列表查看卡方检验结果判断两个因子变量是否独立(使用卡方检验验证独立性)
Leetcode depth first and breadth first traversal
酷炫操作预热!代码实现小星球特效
算法---不同路径(Kotlin)
安全保障基于软件全生命周期-NetworkPolicy应用
Tutorial on the principle and application of database system (058) -- MySQL exercise (2): single choice question
Machine learning (Zhou Zhihua) Chapter 6 notes on Support Vector Learning