MySQL was started with service mysql start only, but it is not showing the default path of my.cnf:

[root@localhost home]# ps -ef|grep mysql
root     23505     1  0 19:23 pts/4    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid
mysql    23596 23505  0 19:23 pts/4    00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/localhost.localdomain.err --pid-file=/var/lib/mysql/localhost.localdomain.pid
root     23713 19420  0 19:49 pts/4    00:00:00 grep mysql

my.cnf is not under all our default locations.

When I start MySQL by creating a new my.cnf it does not start up.

I want to restart MySQL & add a variable in my.cnf.

When I remove my.cnf from /etc, MySQL is starting up with out any errors.


To locate all "my.cnf" in the system:

$ find / -name my.cnf

Make sure that you are entering the variable under the proper heading. Check an example my.cnf, and you'll see that headings appear like this [mysqld]. If you don't put your directive under the correct heading, it won't work. I haven't heard of the variable you're talking about, but try putting it under "[mysqld]" like so:


Also check startup errors. You may find the variable name doesn't exist or some other error is in your config file.

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.