I am not sure how much battery life suffers on my laptop when it is unnecessarily running Apache, PostgreSQL and MySQL, but the databases consistently show up in the list when I use PowerTop, so it is probably not insignificant. Anyway, since I knew it couldn’t be to hard to shut them down and start them up again when I needed to, I wrote a couple little bash scripts to do the job.
sudo /etc/init.d/mysql start
sudo /etc/init.d/mysql stop
To reuse these you might have to modify them for your particular server setup, but that would be relatively easy. The other thing I did is to make them executable. Then I put them on my desktop and I treat them like simple switches. Click on. Click off. Easy! All this made me think again about the merits of using something like XAMPP for development environments. Not really sure what I would lose or gain by doing that, but one thing I do remember from my Windows days when I used it that it had a control panel with lots of handy on/off/restart switches.
Just use docker or some sort of container thing.