天蓬老师2017-04-17 16:43:55
Solved.
Solution:
Logically speaking, mysql should read the configuration file from the address specified by
--defaults-file
Then read the configuration file from the address specified by
--defaults-file-extra
I have not specified either of these, so the reading order should be:
/etc/my.cnf
/etc/mysql/my.cnf
~/mysql/my.cnf
..
Step by step to read the configuration file, but the startup keeps reporting an error that the pid file directory cannot be found.
However, the pid specified in my /etc/my.cnf is
The file is the $base_dir directory, but the error message is not in this directory.
So I guessed that the reading order and steps of the configuration files were different from what I imagined, so I deleted the my.cnf files in other directories.
That is: deleted the /etc/mysql[my.cnf] directory
fixed.
The result is solved, but a question remains, why the configuration file read first is not the /etc/my.cnf file. To be understood.