mysql.server — MySQL Server Startup Script for  bin  and  data  directories. For source distributions, it looks for  libexec  and  var  directories. This condition should be met if you execute  mysqld_safe  from your MySQL installation directory (for example,  /usr/local/mysql  for a binary distribution). •If the server and databases cannot be found relative to the working directory,  mysqld_safe  attempts to locate them by absolute path names. Typical locations are  /usr/local/libexec  and  /usr/local/ var . The actual locations are determined from the values configured into the distribution at the time it was built. They should be correct if MySQL is installed in the location specified at configuration time. Because  mysqld_safe  tries to find the server and databases relative to its own working directory, you can install a binary distribution of MySQL anywhere, as long as you run  mysqld_safe  from the MySQL installation directory: If  mysqld_safe  fails, even when invoked from the MySQL installation directory, specify the  --ledir and  --datadir  options to indicate the directories in which the server and databases are located on your system. cd  mysql_installation_directory bin/mysqld_safe & mysqld_safe  tries to use the  sleep  and  date  system utilities to determine how many times per second it has attempted to start. If these utilities are present and the attempted starts per second is greater than 5, mysqld_safe  waits 1 full second before starting again. This is intended to prevent excessive CPU usage in the event of repeated failures. (Bug #11761530, Bug #54035) When you use  mysqld_safe  to start  mysqld ,  mysqld_safe  arranges for error (and notice) messages from itself and from  mysqld  to go to the same destination. There are several  mysqld_safe  options for controlling the destination of these messages: If none of these options is given, the default is  --skip-syslog . When  mysqld_safe  writes a message, notices go to the logging destination ( syslog  or the error log file) and  stdout . Errors go to the logging destination and  stderr . Controlling  mysqld  logging from  mysqld_safe  is deprecated. Use the server’s native  syslog  support instead. For more information, see Section 5.4.2.8, “Error Logging to the System Log” . • --log-error= file_name : Write error messages to the named error file. • --syslog : Write error messages to  syslog  on systems that support the  logger  program. • --skip-syslog : Do not write error messages to  syslog . Messages are written to the default error log file ( host_name .err  in the data directory), or to a named file if the  --log-error  option is given. Note 4.3.3 mysql.server — MySQL Server Startup Script MySQL distributions on Unix and Unix-like system include a script named  mysql.server , which starts the MySQL server using  mysqld_safe . It can be used on systems such as Linux and Solaris that use System V-style run directories to start and stop system services. It is also used by the macOS Startup Item for MySQL. mysql.server  is the script name as used within the MySQL source tree. The installed name might be different (for example,  mysqld  or  mysql ). In the following discussion, adjust the name  mysql.server  as appropriate for your system. 388