Mysql – Why “.the.cnf” file is empty

innodbmy.cnfMySQL

I want to edit some of InnoDB variables ,I go to the .my.cnf which is located in home/.my.cnf I found the file just empty.

And when I check SHOW VARIABLES in MySQL it gives me all the variables and their values.

Why the file is empty and how can I edit the needed variables ? and can that affect my database or damage it in anyway?

NEEDED Variable:

innodb_buffer_pool_size = 16G
innodb_additional_mem_pool_size = 2G
innodb_log_file_size = 1G
innodb_log_buffer_size = 8M

Best Answer

The ~/.my.cnf file is usually used for client options (for example changing the default port or host).

mysqld will likely start as a different user and will not read your .my.cnf file. It is recommended to set these options in /etc/my.cnf instead.