Need help understanding the MYSQL config files and optimization

I'm following the guide to hosting a website on Linode. https://www.linode.com/docs/websites/hosting-a-website When I got to installing MYSQL it told me to go to /etc/mysql/my.cnf to edit the config files. However when I go to that file and open it all I get is this text.

  GNU nano 2.5.3           File: /etc/mysql/my.cnf                              

#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

I assume that that means I should edit the file in /etc/mysql/conf.d so I go there and open up mysqld.cnf because that's the only one I can find that has actual values in it. I edit the values to the ones posted in the guide but I'm not sure if my settings are going through. When I logged into MYSQL and typed "SHOW VARIABLES" it said that the max connections was set to 151 when I clearly set it at 75. Why is that? I wish I could give you more info but I'm also trying to figure out how I can maybe dump the settings into a text file to analyze them better. I'm really new to this and don't quite understand it.

Also I'm kind of noticing that a lot of the linode documentation is outdated. It seems to be centered around Ubuntu 14.04 and an older version of MYSQL. Is there any chance of that changing soon?

1 Reply

CentOS uses mariadb by default, which uses the following paths:

/etc/my.cnf (which points to the my.cnf.d directory, below)

/etc/my.cnf.d/client.cnf

/etc/my.cnf.d/mysql-clients.cnf

/etc/my.cnf.d/server.cnf

With all the relevant options going to /etc/my.cnf.d/server.cnf.

My suggestion, is to ignore those guides and use something more…. "lively" :) like the mysqltunner script, which can give you real suggestions based on your system usage.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct