当前位置:网站首页>How to query and modify parameter status values
How to query and modify parameter status values
2022-07-21 08:16:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack .
Q: What is the “ database ”? A: That is to say, database instances ,“ database ” = Database software + database : Stored on disk
1、 There are tables in the database : Put in datadir Under the table of contents
mysql> show variables like 'datadir'; +---------------+----------+
| Variable_name | Value |
+---------------+----------+
| datadir | /mydata/ |
+---------------+----------+
2、 Software is used to manage databases : Put in basedir Under the table of contents
mysql> show variables like 'basedir'; +---------------+------------------+
| Variable_name | Value |
+---------------+------------------+
| basedir | /usr/local/mysql |
+---------------+------------------+
3、 Overview of working principle of database
Users connect to the database , Operate on the database , Read the data in the database in the disk into the memory ( Physical reads ), The data in memory is read by the user ( Memory reading ), The speed of memory reading ( Basically negligible ) It is tens of thousands of times faster than physics reading .
The reason why the database is fast is , The database has a large memory as a cache , Less reading of disk files , It will reduce the speed .
MySQL After starting , First, a small space will be allocated in the memory as the user workspace , Enough can be used. ; As users use the database , Space expands gradually , Maximum to innodb_buffer_pool_size The value of ( The space size can account for at least half of the physical memory , It is generally set to the physical memory of the server 70%).
So here comes the question , How to MySQL Parameters in the database 、 Query the status value 、 What about the revision ?
1、 Query and modification of parameter status value
In the official document Server Option / Variable Reference part , For reference MySQL Parameter variables and state values
1、cmd-line Indicates whether the mysql Safe start (mysqld_safe) Set parameters on the command line of –var_name=……
2、option file Indicates whether the mysql Parameter file of (my.cnf) Set parameters in
3、system var Indicates whether it is a system variable @@: overall situation 、 conversation
4、status var Indicates whether it is a state variable
5、var scope Represents the range of variables : overall situation global、 conversation session、both The representation can be at the global level , It can also be used at the session level
6、dynamic Indicates whether it is a dynamic parameter ,yes It's dynamic ,no Is static ,varies It depends on the database version
2、 Use official documents for reference MySQL The variable parameters of 、 State parameters :
1、 name
2、 effect
3、 Modify the range of values
4、 Company
5、 Whether to restart or not
6、 The size of the default value
7、 Scope
Be careful :
If it is the modification of global system variables , It's better to be in mysql> set @@global.var_name=…; After modification , take global.var_name=… The modification of variables is written into the parameter file at the same time , That is to say MySQL Configuration file for my.cnf Keep it in .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/108330.html Link to the original text :https://javaforall.cn
边栏推荐
- 马斯克回应是否会将大脑上传到云端:Already did it!
- Question d'entrevue 2
- 综述 | 图像去噪综合比较研究
- C language practice item: Sanzi chess
- 从放弃到精通,这13篇推荐系统论文一定要读!【附资料】
- 【机器学习】模型选择(交叉验证)原理及实战
- 动态库和静态库(.so/dll,.a/lib)
- FC can the background script be run all the time? For example, keep going to the database to get data processing and write it to another database
- The KAP function of the epidisplay package of R language calculates the proportion of the calculation consistency of the paired contingency table and the value of kappa statistics (total consistency,
- 通过vmlinuz定位到内核代码
猜你喜欢
安全第三天课后练习
Lesson 2 WiFi experiment of hi3861 -api-2
内核结构与设计
史上最全的mysql数据类型汇总-(上)
面試真題2
转:情绪的内耗,才是你人生低效的最大根源
Highly recommended | overview of convolutional neural networks: from basic technology to research prospects
开源demo| ARCall 小程序开源示例发布
史上最全的mysql数据类型汇总(下)
Four redis cluster schemes you must know and their advantages and disadvantages
随机推荐
【线性DP】数字三角形
R language uses the mean function to calculate the relative frequency of the specified variables in the sample (observation) data: calculate the proportion of the value of the specified data column in
stap命令行小技巧(笔记,持续更新)
安全第二天课后练习
物联网常用的无线通信技术
综述 | 图像去噪综合比较研究
模块学习(三)——激光测距模块(TOF10120)
Visual Studio Code 安装包下载慢&&安装&&环境配置&&新建一条龙详解
【Redis】常见知识点总结
Director of Shanghai Bureau of culture and Tourism: safety is the lifeline of culture and tourism, and we are seizing the new track of yuancosmos
面试题:八皇后问题(N皇后问题)「建议收藏」
Kubernetes 集群中流量暴露的几种方案
#yyds干货盘点# 解决名企真题:小招喵跑步
内核结构与设计
With the release of Hongmeng 3.0, multi screen integration has been steadily promoted, but Google has suffered another setback
fc能一直运行后台脚本程序吗?例如不停的去数据库拿数据处理写到另一个数据库
RENIX_IPv6自动配置——网络测试仪实操
C language practice item: Sanzi chess
Apache Bench(ab)压力测试概述-从0到1涵盖各大使用场景
Overview | comprehensive comparative research on image denoising