安装mysql问题解决

[root@apollo init.d]# /etc/init.d/mysqld start
my_print_defaults: Can't read dir of '/etc/my.cnf.' (Errcode: 2 - No such file or directory)
my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
Starting MySQL.my_print_defaults: Can't read dir of '/etc/my.cnf.' (Errcode: 2 - No such file or directory)
my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
my_print_defaults: Can't read dir of '/etc/my.cnf.' (Errcode: 2 - No such file or directory)
my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
Logging to '/data/mysql/apollo.err'.
ERROR! The server quit without updating PID file (/data/mysql/apollo.pid).

============================================

没有 Can't read dir of '/etc/my.cnf.' 提示 的'/etc/my.cnf.'文件夹

千万不要忘记这个点 ‘.’

[root@apollo init.d]# mkdir /etc/my.cnf.    

创建这个加.的文件成功

============================================

[root@apollo init.d]# /etc/init.d/mysqld start
Starting MySQL.Logging to '/data/mysql/apollo.err'.
........................................ SUCCESS!

原文地址:https://www.cnblogs.com/apolloren/p/9979614.html