Mysql Mariadb配置未从my.cnf加载

Mysql Mariadb配置未从my.cnf加载,mysql,mariadb,my.cnf,Mysql,Mariadb,My.cnf,My.cnf中的My mariadb配置未针对“日志错误”和“pid文件”加载。我已检查是否加载了其他配置参数 [root@kvm10 ~]# cat /etc/my.cnf [mysqld] !includedir /etc/mysqld/conf.d datadir=/mnt/mgmt/var/lib/mysql socket=/var/lib/mysql/mysql.sock tmpdir=/mnt/mgmt/var/lib/mysql_tmp user=mysql # Disabling

My.cnf中的My mariadb配置未针对
“日志错误”
“pid文件”
加载。我已检查是否加载了其他配置参数

[root@kvm10 ~]# cat /etc/my.cnf
[mysqld]
!includedir /etc/mysqld/conf.d
datadir=/mnt/mgmt/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
tmpdir=/mnt/mgmt/var/lib/mysql_tmp
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
### TRT-3229 #####
sync_binlog=1
innodb_flush_method=O_DIRECT
innodb_support_xa = 1
myisam_repair_threads = 2
myisam_recover_options = FORCE
###################
innodb_file_per_table=1
innodb_log_buffer_size = 8M
table_open_cache=256
max_heap_table_size=256M
### TRT-4685 ###
max_connections=500
################
innodb_log_file_size = 512M

[mysqld_safe]
log-error=/var/log/mariadb/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[root@kvm10 ~]# 
但是MariaDB没有选择
日志错误
pid文件
的配置值

[root@kvm10 ~]# mysql -e "show variables like 'pid_file'"
+---------------+-----------------------------------+
| Variable_name | Value                             |
+---------------+-----------------------------------+
| pid_file      | /mnt/mgmt/var/lib/mysql/kvm10.pid |
+---------------+-----------------------------------+
[root@kvm10 ~]# mysql -e "show variables like 'log_error'"
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_error     |       |
+---------------+-------+
[root@kvm10 ~]# 

我是错过了什么还是犯了什么错误。我已经检查了
/var/log/mariadb/mysqld.log
&
/var/run/mysqld/mysqld.pid
中的文件权限

如果通过直接或通过旧式init脚本(MariaDB 5.5/10.0或更旧的Linux发行版)运行
mysqld_safe
启动服务器,则应选择配置文件中的这些选项。如果您的MariaDB 10.1+和Linux发行版支持
systemd
并通过服务启动MariaDB服务器,则不使用
mysqld\u safe

它们可能不起作用的另一个原因是,如果启动
mysqld_safe
时没有
--defaults file
选项,并且在默认位置的其他地方有另一个配置文件覆盖了这些选项

1) 将选项添加到配置文件的
[mysqld]
部分,重新启动服务器并查看是否有帮助

如果没有帮助

2a)如果您通过
systemd
服务运行MariaDB服务器,请检查服务配置,可能有问题


2b)如果您通过
mysqld_safe
运行MariaDB服务器,请尝试使用
--defaults file=/etc/my.cnf
启动它,以确保仅使用此配置文件。

此问题与软件开发无关,dba在dba.stackexchange.com姐妹站点上回答此问题会更好。