Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying without success to set mysql to start automatically (mysql 5.6 on RHEL6.4) When I run "service --status-all" after server (redhat) restart it always shows "MySQL is not running, but lock file /var/lock/subsys/mysqld[FAILED]

If I will run manually service mysql restart\start it will work.

I added mysql to chkconfig as follow: chkconfig --add mysql chkconfig mysql on

[root@istahuins09 ~]# chkconfig mysql --list
mysql           0:off   1:off   2:on    3:on    4:on    5:on    6:off

I also tried to remove and add again to chkconfig using --del chkconfig --del mysql

service mysql status

Shows: MySQL is not running, but lock file (/var/lock/subsys/mysql[FAILED]

I tried to reinstall from scratch (redhat and mysql) and after clean install:

  1. The service mysql did not work (manually and automatically).
  2. I recreate /etc/init.d/mysql as a link to mysql.server and now the service may start manually.
  3. The service still refuse to start after server boot.

my.cnf: # Performance configuration [client]
default-character-set = utf8 socket = /fs0/mysql/instance/1/run/mysql.sock

[mysql]                                  
default-character-set                   = utf8 
socket                                  = /fs0/mysql/instance/1/run/mysql.sock

[mysqld]                                 
user                                    = mysql

port                                    = 3306
default_storage_engine                  = InnoDB


# FILE LOCATION #                        
#basedir                                 = /usr
datadir                                 = /fs0/mysql/instance/1/data
tmpdir                                  = /fs0/mysql/instance/1/tmp
socket                                  = /fs0/mysql/instance/1/run/mysql.sock
pid-file                                = /fs0/mysql/instance/1/run/mysql.pid

log-error                               = /fs0/mysql/instance/1/log/mysql.log

slow_query_log_file                     = /fs0/mysql/instance/1/log/slow_queries.log

log_bin                                 = /fs0/mysql/instance/1/binlog/binlog
log_bin_index                           = /fs0/mysql/instance/1/binlog/binlog.index
relay-log                               = /fs0/mysql/instance/1/relay/relay.log
relay-log-index                         = /fs0/mysql/instance/1/relay/relay.index
relay-log-info-file                     = /fs0/mysql/instance/1/relay/relay.info
master-info-file                        = /fs0/mysql/instance/1/relay/master.info

innodb_data_home_dir                    = /fs0/mysql/instance/1/data
innodb_log_group_home_dir               = /fs0/mysql/instance/1/binlog

# MyISAM #                               
key_buffer_size                         = 32M
myisam_recover                          = FORCE,BACKUP


# SAFETY #                               
max_allowed_packet                      = 16M
max_connect_errors                      = 1000000
sysdate_is_now                          = 1
innodb                                  = FORCE
innodb_strict_mode                      = 1

# TUNING #                               
tmp_table_size                          = 128M
max_heap_table_size                     = 128M
query_cache_type                        = 1
query_cache_size                        = 64M
query_cache_limit                       = 4M
max_connections                         = 5000
thread_cache_size                       = 128
open-files-limit                        = 25000
table_definition_cache                  = 2048
table_open_cache                        = 5000
wait_timeout                            = 330
back_log                                = 50
binlog_cache_size                       = 1M
max_binlog_size                         = 50M

sort_buffer_size                        = 4M
join_buffer_size                        = 4M
read_buffer_size                        = 2M
read_rnd_buffer_size                    = 1M


thread_stack                            = 256K




# INNODB #                               
innodb_flush_method                     = O_DIRECT
innodb_buffer_pool_size                 = 3G
innodb_buffer_pool_instances        = 10
innodb_file_per_table                   = 1
innodb_flush_log_at_trx_commit          = 2
innodb_log_file_size                    = 128M
innodb_log_files_in_group               = 2
innodb_status_file                      = 1
innodb_thread_concurrency               = 10
innodb_lock_wait_timeout                = 90
innodb_log_buffer_size                  = 32M
innodb_max_dirty_pages_pct              = 75
innodb_additional_mem_pool_size         = 512M
innodb_autoextend_increment             = 32
innodb_purge_threads            = 1
innodb_open_files           = 5000


# LOGGING #                              
log-queries-not-using-indexes           = 1
slow-query-log                          = 1
long_query_time                         = 3
log-warnings                            = 2



log-slave-updates                        

# GENERAL #                              

lower_case_table_names                  = 1
skip_external_locking                   = 1
character-set-server                    = utf8
collation-server                        = utf8_unicode_ci
log_bin_trust_function_creators     = TRUE

# PERFROMANCE SCHEMA                     
performance_schema                      = ON

mysql.log:

140507 10:49:11 mysqld_safe Starting mysqld daemon with databases from /fs0/mysql/instance/1/data
2014-05-07 10:49:15 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-05-07 10:49:16 11401 [Note] Plugin 'FEDERATED' is disabled.
2014-05-07 10:49:16 7f669f48a720 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2014-05-07 10:49:16 11401 [Note] InnoDB: The InnoDB memory heap is disabled
2014-05-07 10:49:16 11401 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-05-07 10:49:16 11401 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-05-07 10:49:16 11401 [Note] InnoDB: Using Linux native AIO
2014-05-07 10:49:16 11401 [Note] InnoDB: Using CPU crc32 instructions
2014-05-07 10:49:16 11401 [Note] InnoDB: Initializing buffer pool, size = 3.0G
2014-05-07 10:49:17 11401 [Note] InnoDB: Completed initialization of buffer pool
2014-05-07 10:49:17 11401 [Note] InnoDB: Highest supported file format is Barracuda.
2014-05-07 10:49:17 11401 [Note] InnoDB: 128 rollback segment(s) are active.
2014-05-07 10:49:17 11401 [Note] InnoDB: Waiting for purge to start
2014-05-07 10:49:17 11401 [Note] InnoDB: 5.6.12 started; log sequence number 1626143
2014-05-07 10:49:17 11401 [Note] Server hostname (bind-address): '*'; port: 3306
2014-05-07 10:49:17 11401 [Note] IPv6 is available.
2014-05-07 10:49:17 11401 [Note]   - '::' resolves to '::';
2014-05-07 10:49:17 11401 [Note] Server socket created on IP: '::'.
2014-05-07 10:49:18 11401 [Note] Event Scheduler: Loaded 0 events
2014-05-07 10:49:18 11401 [Note] /usr/sbin/mysqld: ready for connections.

Version: '5.6.12-log' socket: '/fs0/mysql/instance/1/run/mysql.sock' port: 3306 MySQL Community Server (GPL) 2014-05-07 10:49:48 11401 [Note] /usr/sbin/mysqld: Normal shutdown

2014-05-07 10:49:48 11401 [Note] Giving 0 client threads a chance to die gracefully
2014-05-07 10:49:48 11401 [Note] Event Scheduler: Purging the queue. 0 events
2014-05-07 10:49:48 11401 [Note] Shutting down slave threads
2014-05-07 10:49:48 11401 [Note] Forcefully disconnecting 0 remaining clients
2014-05-07 10:49:48 11401 [Note] Binlog end
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'partition'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'ARCHIVE'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'BLACKHOLE'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_METRICS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_CMPMEM'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_CMP'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_LOCKS'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'INNODB_TRX'
2014-05-07 10:49:48 11401 [Note] Shutting down plugin 'InnoDB'
2014-05-07 10:49:48 11401 [Note] InnoDB: FTS optimize thread exiting.
2014-05-07 10:49:48 11401 [Note] InnoDB: Starting shutdown...
2014-05-07 10:49:49 11401 [Note] InnoDB: Shutdown completed; log sequence number 1626153
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'MRG_MYISAM'
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'CSV'
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'MEMORY'
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'MyISAM'
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'sha256_password'
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'mysql_old_password'
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'mysql_native_password'
2014-05-07 10:49:49 11401 [Note] Shutting down plugin 'binlog'
2014-05-07 10:49:49 11401 [Note] /usr/sbin/mysqld: Shutdown complete
share|improve this question
    
The environment (PATH, environ vars, etc) in the startup process is different than these items in your path. It will be your job to find the problematic vars, missing items in the path and address them. –  mdpc May 7 at 8:30
    
It would be nice if you posted your my.cnf config file. It might provide more details to the community. –  val0x00ff May 7 at 8:37
    
I added my.cnf to my original question –  Gidi Kern May 7 at 11:48

1 Answer 1

You need to configure the daemon which is called mysqld. You are trying to configure the client to run as a daemon on startup.

chkconfig mysqld on

service mysqld start

share|improve this answer
    
I did as mentioned in documentation cp /usr/share/mysql/mysql.server /etc/init.d/mysql. –  Gidi Kern May 7 at 10:30
    
cp /usr/share/mysql/mysql.server /etc/init.d/mysql chmod +x /etc/init.d/mysql chkconfig --add mysql chkconfig --level 345 mysql on service mysql start There server start when running manually but doesn't when restarting redhat. I tried to do chkconfig on mysqld but when doing chkconfig --add mysqld it refused to add it as mysqld does not support chkconfig. –  Gidi Kern May 7 at 10:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.