mysql.server - MySQL Server Startup Script


The mysql.server will change the location to the MySQL installation directory. It will then invoke the mysqld_safe. To run the server as a specific user, an appropriate user option can be added to the [mysqld] group of the global /etc/my.cnf option file.

  • It changes location to the MySQL installation directory, and later invokes mysqld_safe.

  • To run the server as a specific user, an appropriate user option can be added to the [mysqld] group of the global /etc/my.cnf option file.

  • It may be required to edit the mysql.server if it was installed as a binary distribution of MySQL in a nonstandard location.

  • It has to be modified to change the location into a proper directory before it runs mysqld_safe.

  • If this is done, the modified version of mysql.server would be overwritten if you upgrade MySQL in the future. Ensure that a copy of the edited version is made so that it can be reinstalled.

  • mysql.server stop stops the server by sending a signal to it. It can also be stopped manually by executing mysqladmin shutdown.

Let us understand some of the command line options associated with it −

basedir=dir_name

It refers to the path to the MySQL installation directory.

datadir=dir_name

It refers to the path to the MySQL data directory.

pid-file=file_name

It refers to the path name of the file in which the server will have to write its process ID. The server creates the file in the data directory, otherwise an absolute path name is given to specify a different directory.

service-startup-timeout=seconds

it tells how long (in seconds) the user has to wait for the confirmation of server startup. If the server doesn’t start within this time, mysql.server exits with an error. The default value is 900. A value of 0 means the user shouldn’t wait at all for startup. Negative values mean to wait forever (this refers to a no timeout situation).

Updated on: 10-Mar-2021

320 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements