I want to modify these values:

key_buffer_size    = 256M
max_allowed_packet  = 128M
thread_stack    = 256K
query_cache_limit  = 64M
query_cache_size        = 384M
innodb_buffer_pool_size = 1073741824
thread_cache_size = 256
back_log = 256
thread_handling = pool-of-threads

I've tried to edit the files that MariaDB says:

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf 

But none of them seems to apply changes.

I'm running last version of MariaDB on Ubuntu 18.04 (10.1.34-MariaDB-0ubuntu0.18.04.1)

I've checked Stack Overflow before asking, including How do I find the MySQL my.cnf location

  • Are your cnf files pulling in other cnf files that may be overwriting the changes you made? – Skippy VonDrake Sep 20 '18 at 20:46
  • 1
    See if there is already some kind of "include" at the end of /etc/my.cnf. – Rick James Oct 3 '18 at 0:14

I had a similar problem but rectified it by adding the following line to /etc/mysql/my.cnf

!include /etc/mysql/mariadb.cnf

This seemed to fix the issue of the mariadb config file not being read.

| improve this answer | |

Configuring MariaDB with my.cnf

When SYSCONFDIR is not defined (for example, in binary tarballs and DEB packages)

Location             | Scope
/etc/my.cnf          | Global
/etc/mysql/my.cnf    | Global
$MYSQL_HOME/my.cnf   | Server
defaults-extra-file  | File specified with --defaults-extra-file=path, if any
~/.my.cnf            | User

When SYSCONFDIR is defined (for example, in RPM packages it is /etc)

Location            |  Scope
SYSCONFDIR/my.cnf   |  Global
$MYSQL_HOME/my.cnf  |  Server
defaults-extra-file |  File specified with --defaults-extra-file=path, if any
~/.my.cnf           |  User
| improve this answer | |

You didn't mention if you had restarted your server.

You must restart your server after changes are made, or it won't read the variables. If you're using systemd it's:

systemctl restart mysql

Or if you're using sysV it's:

sudo service mysql restart

... Also you must be sure that the server restarts, as it can die if the options files are messed up. The way I normally test this is with something like:

mysql -u root -p

Which should give you a


prompt. Hit quit to end this tool.

| improve this answer | |

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.