I have the MySQL 5.6 installed on CentOS6.4.
I read this
http://dev.mysql.com/doc/refman/5.6/en/server-default-changes.html http://dev.mysql.com/doc/refman/5.6/en/server-default-configuration-file.html
i have the my.cnf
in /usr/my.cnf
folder.
Currently the pid file is being written in /tmp
folder because i got error few hours back
now i have two questions
To check the PID file for the mysqld node: the default location for it is the data directory of the node, specified by the datadir option in either a configuration file or at the command line at the start of the mysqld process. Let's go to the data directory /home/ari/bin/cluster/wild-cluster/51/data on host 198.51.
The MySQL PID file is a process identification file that stores the Process ID number of the running MySQL instance. Each time you issue a command to mysql. server , MySQL would look for the PID file to find the Process ID and forward the command to the right process number.
To answer your questions:
1) To find out wehere mysql stores its pid file use the following:
mysql> show variables like '%pid%';
+---------------+-------------------------------+
| Variable_name | Value |
+---------------+-------------------------------+
| pid_file | /var/lib/mysql/your-db.pid |
+---------------+-------------------------------+
2) You can change this either by setting in in the my.cnf, here the option would look like the following pid-file=/var/lib/mysql/your-db.pid
. Or you can change it by altering startup parameters and append --pid-file=/var/lib/mysql/your-db.pid
. I would strongly suggest that you stick to the my.cnf option, the other solution would require some fiddling in your start-scripts.
3) You find the documentation here: http://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_pid-file
I just wanted to add that you can put the pid file wherever it suits you best, this means you don´t need to put it in your datadir or mysql-home. But a "clean" way to do so is under /var/run/
under linux.
you can change the pid file in my.cnf it self. Mostly my.cnf will be available in /etc/my.cnf. you can edit the path of pid file. please find the below entry as an example...
datadir = /var/lib/mysql pid-file=/var/lib/mysql/mysqld.pid
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With