当前位置:网站首页>MySQL详细安装与配置
MySQL详细安装与配置
2022-08-02 18:11:00 【Slcp】
MySQL详细安装与配置
前期准备
- 安装包
下载二进制安装所需的包
链接:https://pan.baidu.com/s/1azoIIZqVw948xLnew2TEJQ
提取码:g7pl

- 检查
执行rpm -ea | grep MySQL,查看服务器是否安装旧版本MySQL
使用命令rpm -e --node’s {-file-name}进行MySQL删除操作,移除的时候可能会有依赖,要注意一定的顺序。

发车
1、把mysql的安装包复制到linux中。

2、安装mysql
rpm -Uvh *.rpm --nodeps --force;
3、修改配置
安装完成之后,修改my.cnf,路径: /etc/my.cnf
文件已提供~
#推荐配置:在my.cnf文件最下面加上如下配置
lower_case_table_names = 1
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
max_connect_errors = 6000
interactive_timeout=7200
back_log=500
max_connections=3000
max_user_connections=300
skip-name-resolve
key_buffer_size=20480M
query_cache_size=512M
query_cache_type=1
read_buffer_size=32M
sort_buffer_size=32M
join_buffer_size =512M
read_rnd_buffer_size=32M
tmp_table_size=128M
thread_cache_size=128
max_allowed_packet=32M
binlog_cache_size = 4M
4、启动MySQL
启动:# service mysqld start
# 停止
service mysqld stop
#重启
service mysqld restart
5、查看临时密码
grep 'temporary password' /var/log/mysqld.log

6、登录mysql数据库
mysql -u root -p
#修改root密码
set password for [email protected]=password('[email protected]');
#退出mysql登录
exit
#mysql数据库默认是有密码复杂度验证的,如果不需要可以去掉:
#关闭密码复杂度验证
set global validate_password_policy=0;
#新密码长度大于等于1
set global validate_password_length=1;
7、授权root用户远程访问权限
#授权
grant all privileges on *.* to 'root'@'%' identified by '[email protected]';
#刷新操作
flush privileges;
#退出mysql然后重启mysql
exit
service mysqld restart;
8、连接navicat

9、其他
#查看防火墙:
systemctl status firewalld.service;
#打开防火墙:
systemctl start firewalld.service;
#关闭防火墙:
systemctl stop firewalld.service;
#永久禁止防火墙:
systemctl disable firewalld.service;
#开启状态:active(running)
#关闭状态:disavtive(dead)
边栏推荐
- Five keys to a successful Industrial IoT deployment
- Open Source Summer | [Cloud Native] DevOps (5): Integrating Harbor
- Technical life | How to draw a big picture of business
- redis总结_基础
- LeetCode 2343. 裁剪数字后查询第 K 小的数字
- IDEA相关配置(特别完整)看完此篇就将所有的IDEA的相关配置都配置好了、设置鼠标滚轮修改字体大小、设置鼠标悬浮提示、设置主题、设置窗体及菜单的字体及字体大小、设置编辑区主题、通过插件更换主题
- Win11主题下载一直转圈怎么办?Win11主题下载一直转圈的解决方法
- What skills are the most practical for college students in communications?
- 数据治理:数据集成和应用模式的演进
- 新公链时代的跨链安全性解决方案
猜你喜欢

技术人生 | 如何画业务大图

mongodb的游标

Go 语言快速入门指南: 介绍及安装

Smart Microelectronics Releases Low-Power MM32L0130 Series MCU Products

“12306”的架构到底有多牛逼?

Code Inspection for DevOps

NeRF: The Secret of 3D Reconstruction Technology in the Popular Scientific Research Circle

宝塔搭建实测-基于ThinkPHP5.1的wms进销存源码

Playing in the cloud | The key technology of Tianyi cloud object storage ZOS high availability is revealed

How to build a quasi-real-time data warehouse?
随机推荐
Endanger the safety of common Internet attacks have?
固态硬盘接口类型介绍
从技术全景到场景实战,透析「窄带高清」的演进突破
千万级别的表分页查询非常慢,怎么办?
How to deal with security risks posed by machine identities
E-Surfing Cloud 4.0 Distributed Cloud Enables Digital Transformation of Thousands of Industries
有关代购系统搭建的那点事
WPF使用Prism登录
如何确保智能工厂的安全?
NIO's Selector execution process
电子行业库存管理痛点与WMS仓储管理系统解决方案
进程与线程
仿制药的未来商机--个人研发的体会
[论文分享] VideoFlow: A Flow-Based Generative Model for Video
衡量软件产品质量的 14 个指标
MySQL LIKE – 语法和用法示例教程
Redis总结_实战篇
Mobile Banking Experience Test: How to Get the Real User Experience
企业云成本管控,你真的做对了吗?
golang刷leetcode 经典(2)拓扑排序