首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CentOS 7上的MariaDB拒绝读取某些更新的变量

CentOS 7上的MariaDB拒绝读取某些更新的变量
EN

Stack Overflow用户
提问于 2021-10-11 05:29:13
回答 1查看 47关注 0票数 0

我正在尝试为CentOS 7上的MariaDB版本5.5.60更改max_connectionsopen_files_limit。因为可能有多个my.cnf文件,所以我使用mysql --help --verbose来获取可能的位置。下面是输出:

代码语言:javascript
复制
Default options are read from the following files in the given order:
/etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf 

Cnf.etc/ mysql /my.cnf不存在,根也不在我的用户目录、/ .my.cnf /或mysql用户目录(一开始就不存在)中。所以只剩下/etc/my.cnf。它看起来是这样的:

代码语言:javascript
复制
[mysqld]
datadir=/data/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
max_connections = 5000
open_files_limit = 10240

# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

最后一行中的/etc/my.cnf.d包含server.cnf,其中包括以下两行:

代码语言:javascript
复制
[server]
max_connections=5000
open_files_limit=10240

但是,当我运行systemctl restart mariadb时,只有max_connections被更改,但我就是不能让它读取open_files_limit的新值。它一直在这样做:

代码语言:javascript
复制
MariaDB [(none)]> SHOW VARIABLES LIKE 'open_files_limit';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| open_files_limit | 1024  |
+------------------+-------+
1 row in set (0.00 sec)

您是否知道它为什么这样做,以及如何让服务器读取open_files_limit的新值

提前谢谢你

萨沙

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-10-11 10:38:14

open_file_limits变量的值不能高于系统限制。

检查ulimit -n的输出并更改系统配置。最好不要在系统范围内分配这些限制,而是为运行MariaDB服务器的用户分配这些限制。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69521424

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档