Friday, June 9, 2023

MySQL - Enable/Disable auto startup in Unix/Linux

MySQL - Enable/Disable auto startup in Unix/Linux

In this post let's see how to enable or disable auto startup of MySQL Database in Unix based machines

Environment: Fedora Linux v37

Dealing with MySQL

  • Starting MySQL: sudo service mysqld start or sudo systemctl start mysqld
  • Stopping MySQL: sudo service mysqld stop or sudo systemctl stop mysqld
  • Disable auto startup of MySQL Database at the time of system startup
    • Check the current auto startup status using the command sudo service mysqld status or sudo systemctl status mysqld
    • If already enabled for auto start then the result will be as follows
    • Now issue the command sudo systemctl disable mysqld to disable auto startup
    • One can verify now to make sure the auto startup is disabled using the command sudo service mysqld status or sudo systemctl status mysqld
    • Note: the systemctl commands are the modern way of starting/stopping services