当前位置:网站首页>CentOS 7 安装mysql
CentOS 7 安装mysql
2022-07-20 14:39:00 【我是一座离岛】
- 下载mysql源安装包
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
- 安装mysql源
yum localinstall mysql57-community-release-el7-8.noarch.rpm
- 检查mysql源是否安装成功
yum repolist enabled | grep "mysql.*-community.*"
- 安装MySQL
yum install mysql-community-server
- 启动MySQL服务
systemctl start mysqld
- 查看MySQL的启动状态
systemctl status mysqld
- 开机启动
systemctl enable mysqld systemctl daemon-reload
- 修改密码策略和默认编码
//打开配置文件 vi /etc/my.cnf //去掉密码策略验证 validate_password = off //修改默认编码,在[mysqld]下增加 character_set_server=utf8 init_connect='SET NAMES utf8' //重启服务 systemctl restart mysqld
- 修改root本地登录密码
//获取自动生成的密码,如果没有,则可以直接登录 grep 'temporary password' /var/log/mysqld.log //登录 mysql -uroot -p //修改密码 set password for 'root'@'localhost'=password('MyNewPass4!');
- 远程登录
//使用mysql数据库 use mysql; //更新用户表 update user set host = '%' where user='root' and host='localhost'; //重启服务 systemctl restart mysqld
相关参数及配置文件路径:
默认配置文件路径:
配置文件:/etc/my.cnf
日志文件:/var/log//var/log/mysqld.log
服务启动脚本:/usr/lib/systemd/system/mysqld.service
socket文件:/var/run/mysqld/mysqld.pid
基本照抄底下的参考文章,只是添加了一点信息好整理成自己方便使用的模式。
参考:
http://blog.csdn.net/xyang81/article/details/51759200
边栏推荐
- 7.24聚会通知
- Principle analysis of SAP Spartacus reading cart
- Observability improves the quality of software engineering, and observation cloud attends the 2022 qecon global software quality & effectiveness conference
- 线性电路特性的研究与multisim仿真(附工程文件)
- 高并发的深入理解
- One of the tools of SAP ui5 system test: uiveri5
- Mysql中的Enum数据类型实例分析
- How to use node JS access data in SAP Hana cloud database
- About the basic setup of win7/win10 system installation
- Qt连接mysql并操作数据库(最清晰)
猜你喜欢
随机推荐
LCD断码屏显示应用框架
MySQL pessimistic lock
7.24聚会通知
Tdengine数据库运行出现的bug
哪些自动化工具赋能电商运营效率翻倍?
常用的锂电池充电IC芯片
MySQL全局锁
理财产品到期了,收益是怎么算的?
Smart lamp pole exhibition | 2022 Nanjing International Smart lamp pole and smart street lamp Exhibition
vector、queue、stack用法详解
DOS汇编程序提高练习
Common lithium battery boost IC
MySQL optimistic lock
SAP BTP 上 Roles,Roles collection 和 Scopes 的关联关系
How do novices register for stock trading? Is it safe to open an account on great wisdom
Automated testing methods for SAP ui5 applications
数字信号处理综合MATLAB设计 双音多频拨号系统
最短 hamilton 路径 题解
JS中的数组开头添加元素
MySQL password modification (teach you by hand)