MySQL systemd on Linux 7
過去在Linux 6系列上用tar包安裝MySQL,要設定成系統服務很簡單,只要把mysql.server放在/etc/init.d裡面即可: cp support-files/mysql.server /etc/init.d/mysqld 但在Linux 7系列中service的角色已被systemd給取代(雖然service還是能用),但要設開機自動啟動chkconfig就會有問題: [root@mysql-course support-files]# chkconfig --list mysqld Note: This output shows SysV services only and does not include native systemd services. SysV configuration data might be overridden by native systemd configuration. If you want to list systemd services use 'systemctl list-unit-files'. To see services enabled on particular target use 'systemctl list-dependencies [target]'. 所以可以的話,我還是盡量設法弄成Linux 7相容的方式比較好 看了手冊的教學:https://dev.mysql.com/doc/refman/5.7/en/server-management-using-systemd.html 實在是太高深莫測了,我功力還不到家,看不太懂阿 後來看這篇http://superuser.com/questions/384365/systemctl-enable-differs-from-systemctl-start-how的說明,試做一下: [root@mysql-course ~]# systemctl status mysqld.service mysqld.service Loaded: not-found (Reason: No such file or di