MySQL Server Not Responding

Issue:

The MySql database will not start.

Troubleshoot:

Look for the following issue code at # /var/log/mysqld.log

# /var/log/mysqld.log
~
121203 07:29:31 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
121203 07:33:39 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
121203 7:33:39 [Note] Plugin 'FEDERATED' is disabled.
121203 7:33:39 InnoDB: The InnoDB memory heap is disabled
121203 7:33:39 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121203 7:33:39 InnoDB: Compressed tables use zlib 1.2.3
121203 7:33:39 InnoDB: Using Linux native AIO
121203 7:33:39 InnoDB: Initializing buffer pool, size = 128.0M
121203 7:33:39 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file ./ib_logfile0 is of different size 0 262144000 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
121203 7:33:39 [ERROR] Plugin 'InnoDB' init function returned error.
121203 7:33:39 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121203 7:33:39 [ERROR] Unknown

Solution:

Navigate to the /etc directory and edit the MySql configuration file.

# cd /etc
# vi my.cnf

Change this

[root@osp1rapidtel etc]# cat /etc/my.cnf
[mysqld]
local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
 
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
 
[root@osp1rapidtel etc]#

to this

[root@mysqldb etc]# vi /etc/my.cnf
[mysqld]
local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
 
# For InnoDB storage engine
default-storage-engine=INNODB
 
# InnoDB data directory
# The deault is "./" which means MySQL data directory.
# innodb_data_home_dir = ./
 
# InooDB data files must be able to hold data and indexes
# But 2G may be a limit for X86
innodb_data_file_path = ibdata1:2000M:autoextend
 
# Buffer pool size to 50-80% of computer's memory
# But 2G may be a limit for X86
innodb_buffer_pool_size=1G
innodb_additional_mem_pool_size=20M
 
# Log file size to about 25% of the buffer pool size
innodb_log_file_size=250M
innodb_log_buffer_size=8M
 
# Other options
innodb_flush_log_at_trx_commit=1
innodb_lock_wait_timeout=50
#innodb_thread_concurrency=5
 
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
 
[root@mysqldb etc]#
 
[root@mysqldb etc]# /etc/init.d/mysqld start
Starting mysqld: [ OK ]
[root@mysqldb etc]#