# The priority of my.cnf

**URL:** <https://forums.percona.com/t/the-priority-of-my-cnf/5776>\
**Category:** Other MySQL® Questions\
**Created:** [July 29, 2017, 5:36am UTC](https://forums.percona.com/t/the-priority-of-my-cnf/5776 "2017-07-29T05:36:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shawnxiong](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@shawnxiong](https://forums.percona.com/u/shawnxiong)\
**Post date:** [July 29, 2017, 5:36am UTC](https://forums.percona.com/t/the-priority-of-my-cnf/5776/1 "2017-07-29T05:36:34Z")

</div>

Hi,

there are something confusing me when I’m going to install Percona-Server-5.5 (Percona-Server-5.5.25a-rel27.1-277.Linux.x86\_64.tar.gz) on Debian 8.8, the steps that Percona-Server installed as follows:

1. apt-get install myql-common (mysql-common\_5.5.55-0+deb8u1\_all.deb), for compiling php

2. fetch Percona-Server-5.5.25a-rel27.1-277.Linux.x86\_64.tar.gz from office site, decompressing to /usr/local/customized\_dir/mysql

3. creates user (mysql); create directory: datadir and logdir, then chown mysql:mysql …

4. config /etc/my.cnf with some paramters (basedir, datadir, logdir…)

5. cp /usr/local/customized\_dir/mysql/support-files/mysql.server /etc/init.d/mysqld

6. mysql\_install\_db --defaults-file=/etc/my.cnf --user=mysql

7. ln -sf ${INSTALL\_DIR}/${MYSQL\_DIR}/bin/\* /usr/local/bin/

step 0 is not necessary for installing Percona-Server-5.5, but it’s will generate a dir with default my.cnf, /etc/mysql/my.cnf

Issues:

if the mysql-common isn’t installed, /etc/init.d/mysqld restart will be succeed;

if the mysql-common installed before Percona-Server, /etc/init.d/mysqld restart will be failed, because it can’t fine mysqld\_safe, the /etc/mysql/my.cnf override /etc/my.cnf, see figure 1.

figure 1

but as the specification of mysql doc and the mysql.server:

as defaults, the SYSCONFDIR should be /etc, so the /etc/my.cnf should override /etc/mysql/my.cnf, but the result is opposite.

Please give me a hand, thanks in advance.

Shawn

 ![1.png](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/4/48d512c48279e64f7d906edace55358169f0a919.png)

 ![2.png](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/d/dd36ac04814f21189438aae5348799e6782d9e06.png)
