Centos7使用yum安装Mysql5.7.19的详细步骤
作者:沧月V587 时间:2024-01-24 13:01:56
Centos7的yum源中默认是没有mysql,因为现在已经用mariaDB代替mysql了。
首先我们下载mysql的repo源,我们可以去mysql官网找最新的repo源地址
地址:
https://dev.mysql.com/downloads/repo/yum/
开始在linux下下载repo源
//下载mysql rpm包
# wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
//安装mysql rpm包
# rpm -ivh mysql57-community-release-el7-11.noarch.rpm
//安装mysql
# yum install mysql-community-server
安装成功后需要重启mysql服务。
# service mysqld restart
刚开始安装的Mysql5.7是会随机生成一个root密码的,我们要先找到这个随机密码,然后改新密码。我们可以通过grep命令查找随机root密码。
[root@local bin]# grep "password" /var/log/mysqld.log
2017-09-24T08:03:30.664086Z 1 [Note] A temporary password is generated for root@localhost: 8A3xwbk8_P1A
使用随机密码登录mysql
[root@local bin]# mysql -uroot -p
Enter password:
进入后重置root密码
mysql> SET password=PASSWORD("mysql123");
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
如果有上面的报错,说明密码设置的过于简单。密码设置规则是要有数字大小写字母和字符串。
最后授予外网登录权限,username为用户名,password是登录密码
mysql>grant all privileges on *.* to username@'%' identified by 'password';
来源:http://www.jianshu.com/p/155a5c468f06?utm_source=tuicool&utm_medium=referral
标签:yum,mysql,Centos7
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Tensorflow 2.1完成对MPG回归预测详解
2023-06-30 07:31:36
![](https://img.aspxhome.com/file/2023/9/115819_0s.png)
Python实现企业微信通知机器人的方法详解
2021-03-12 09:56:02
![](https://img.aspxhome.com/file/2023/9/78629_0s.png)
基于prototype扩展的JavaScript常用函数库
2023-08-24 15:09:57
Golang爬虫框架 colly的使用
2024-02-02 13:40:55
![](https://img.aspxhome.com/file/2023/6/107346_0s.jpg)
Python入门_学会创建并调用函数的方法
2023-10-14 17:12:22
![](https://img.aspxhome.com/file/2023/4/66794_0s.jpg)
Vue项目之学生管理系统实例详解
2024-04-28 09:31:57
![](https://img.aspxhome.com/file/2023/5/132895_0s.png)
Jinja2过滤器的使用、控制语句示例详解
2023-01-30 19:02:00
![](https://img.aspxhome.com/file/2023/1/104911_0s.png)
教你用python将数据写入Excel文件中
2021-12-29 03:28:38
![](https://img.aspxhome.com/file/2023/8/97638_0s.png)
sqlserver利用存储过程去除重复行的sql语句
2024-01-20 06:28:54
![](https://img.aspxhome.com/file/2023/5/110975_0s.png)
Python之根据输入参数计算结果案例讲解
2022-08-27 07:44:50
![](https://img.aspxhome.com/file/2023/9/69499_0s.jpg)
python 使用pandas计算累积求和的方法
2021-05-22 19:46:16
Python基于Flask框架配置依赖包信息的项目迁移部署
2022-03-26 13:54:56
![](https://img.aspxhome.com/file/2023/9/133829_0s.jpg)
Python实现解析命令行参数的常见方法总结
2023-10-15 12:31:49
![](https://img.aspxhome.com/file/2023/0/61440_0s.png)
linux下mysql 5.7.16 免安装版本图文教程
2024-01-18 06:22:56
批量替换 MySQL 指定字段中的字符串
2024-01-18 22:17:23
ASP程序中调用函数Now()显示上午下午的问题
2009-08-27 13:09:00
关于Mysql中current_time/current_date()与now()区别
2024-01-19 15:17:58
MySQL表设计优化与索引 (八)
2010-10-25 19:46:00
TypeScript函数和类型断言实例详解
2024-04-17 10:00:09
![](https://img.aspxhome.com/file/2023/1/136431_0s.jpg)
使用python实现拉钩网上的FizzBuzzWhizz问题示例
2021-06-18 08:41:38