0

My mariadb configuration in my.cnf is not getting loaded for "log-error" and "pid-file". I have checked other configurations params are loaded.

[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 ~]# 

But the configuration value for log-error & pid-file is not picked by MariaDB.

[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 ~]# 

Am I missing somethig or making some mistake. I have checked the files permissions in /var/log/mariadb/mysqld.log & /var/run/mysqld/mysqld.pid.

  • Try moving log-error to the [mysqld] section of the configuration file – Philᵀᴹ Mar 24 '17 at 10:42
2

I am having the same problem in ~/.my.cnf file (MySQL 5.5.5-10.2.6-MariaDB installed via Homebrew).

Apparently it is a recorded bug in both MySQL and MariaDB:

Bug #84172 The pid-file value is ignored in the /etc/my.cnf option file
https://bugs.mysql.com/bug.php?id=84172

pid_file in my.cnf ignored
https://jira.mariadb.org/browse/MDEV-8168

1

Not sure if this is some default behaviour of Mariadb or lack of our knowledge to figure how Mariadb picks its my.cnf.

I have worked to resolve similar issue and made mysqld_safe to point to the my.cnf that we want to pick it, in below fashion.

mysqld_safe --defaults-file=/etc/my.cnf &

Reference Issue : Mariadb - Variable 'innodb_log_file_size' is a read only variable

Reference Chat: http://chat.stackexchange.com/rooms/58883/discussion-between-mannoj-and-bhuvanesh

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.