Autostart mysql on server reboot?
-
Hi all,
As some of you know, I installed a fog server with all your help here. Thanks again. However, when I restart my server, mysql is not running. I have to use systemctl restart mysql to enable it again. This is a bit annoying as you can imagine.
I have tried to run chkconfig --level 345 mysqld on but I get the following:
[root@localhost fogserver]# chkconfig --level 345 mysqld on Note: Forwarding request to 'systemctl enable mysqld.service'. Failed to execute operation: Invalid argument
Also, should I run sudo mysql_secure_installation? Or will this cause issues with fog?
I am running fog server 1.5.5 on centos os 7.
Thanks!
-
@iekozz To enable a service on boot in the systemd world you need to tun
systemctl enable XXX
- whileXXX
should bemariadb
instead ofmysqld
. If it does not work you can try finding out what the service is actually called with the following command:systemctl list-units | grep -e "mysql" -e "maria"
If you are wondering why the manual
restart
worked… This is because there are links set andstop
,start
,status
andrestart
usually work fine with the other names.Also, should I run sudo mysql_secure_installation? Or will this cause issues with fog?
If you are an experienced Linux user I would say
mysql_secure_installation
is a good way to go. But it will most probably cause issues as it forces you to set a proper password an so on. As you still seem new to the Linux world I would say leave that for another day when you have worked your way through. If you’re really keen to do it know, make sure you know at least where to change the mysql passwords in/var/www/html/fog/lib/fog/config.class.php
and/opt/fog/.fogsettings
! -
@Sebastian-Roth Thanks again, that fixed it