What does mysqld_safe do in my.cnf?

Below is my MySQL configuration file. I am trying to understand how this works. What is the meaning of [mysqld_safe] ? Has [mysqld] already started MySQL? Why then do log-error and pid file errors occur?

 [mysqld] # Settings user and group are ignored when systemd is used (fedora >= 15). # If you need to run mysqld under different user or group, # customize your systemd unit file for mysqld according to the # instructions in http://fedoraproject.org/wiki/Systemd user=mysql datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Semisynchronous Replication # http://dev.mysql.com/doc/refman/5.5/en/replication-semisync.html # uncomment next line on MASTER ;plugin-load=rpl_semi_sync_master=semisync_master.so # uncomment next line on SLAVE ;plugin-load=rpl_semi_sync_slave=semisync_slave.so # Others options for Semisynchronous Replication ;rpl_semi_sync_master_enabled=1 ;rpl_semi_sync_master_timeout=10 ;rpl_semi_sync_slave_enabled=1 # http://dev.mysql.com/doc/refman/5.5/en/performance-schema.html ;performance_schema innodb_strict_mode=on sql_mode=TRADITIONAL ;sql_mode=STRICT_TRANS_TABLES,NO_ZERO_DATE,NO_ZERO_IN_DATE character-set-server=utf8 collation-server=utf8_general_ci [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid 
+7
source share
1 answer

You can start the MySQL server using mysqld or mysqld_safe . mysqld_safe may itself try to execute mysqld , but it may also not. See Documentation (first Google result for mysqld_safe, btw):

mysqld_safe is the recommended way to start the mysqld server on Unix and NetWare. mysqld_safe adds some security features, such as restarting the server when an error occurs and logging runtime information in the error log file. NetWare-specific behaviors are listed later in this section.

The [mysqld_safe] section in the configuration file is for settings used when using mysqld_safe to start the MySQL server instead of mysqld .

+6
source

All Articles