重启mysql服务后
查看innodb参数 发现都不见了
查看引擎 发现没有innodb引擎没有了
查看Error log 如下:
InnoDB: bounds; space id 0 page number 89977, page 121 in doublewrite buf.
InnoDB: Warning: a page in the doublewrite buffer is not within space
InnoDB: bounds; space id 0 page number 89978, page 122 in doublewrite buf.
InnoDB: Warning: a page in the doublewrite buffer is not within space
InnoDB: bounds; space id 0 page number 89979, page 123 in doublewrite buf.
InnoDB: Warning: a page in the doublewrite buffer is not within space
InnoDB: bounds; space id 0 page number 89980, page 124 in doublewrite buf.
InnoDB: Warning: a page in the doublewrite buffer is not within space
InnoDB: bounds; space id 0 page number 89981, page 125 in doublewrite buf.
InnoDB: Warning: a page in the doublewrite buffer is not within space
InnoDB: bounds; space id 0 page number 89982, page 126 in doublewrite buf.
InnoDB: Warning: a page in the doublewrite buffer is not within space
InnoDB: bounds; space id 0 page number 89983, page 127 in doublewrite buf.
InnoDB: Error: trying to access page number 13199 in space 0,
InnoDB: space name ./ibdata1,
InnoDB: which is outside the tablespace bounds.
InnoDB: Byte offset 0, len 16384, i/o type 10.
InnoDB: If you get this error at mysqld startup, please check that
InnoDB: your my.cnf matches the ibdata files that you have in the
InnoDB: MySQL server.
120920 16:41:25  InnoDB: Assertion failure in thread 3086124752 in file fil/fil0fil.c line 4123
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html
InnoDB: about forcing recovery.
120920 16:41:25 - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.key_buffer_size=8384512
read_buffer_size=131072
max_used_connections=0
max_threads=151
threads_connected=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 337730 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.thd: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = (nil) thread_stack 0x30000
/usr/local/mysql/libexec/mysqld(my_print_stacktrace+0x22) [0x839cf62]
/usr/local/mysql/libexec/mysqld(handle_segfault+0x37f) [0x81bb54f]
[0xb7f35400]
/lib/libc.so.6(abort+0x101) [0x4c5e2451]
/usr/local/mysql/lib/mysql/plugin/ha_innodb.so(fil_io+0x39c) [0xb6e6881c]
/usr/local/mysql/lib/mysql/plugin/ha_innodb.so [0xb6e4cca4]
/usr/local/mysql/lib/mysql/plugin/ha_innodb.so(buf_read_page+0x273) [0xb6e4d223]
/usr/local/mysql/lib/mysql/plugin/ha_innodb.so(buf_page_get_gen+0x114) [0xb6e45994]
/usr/local/mysql/lib/mysql/plugin/ha_innodb.so(trx_undo_lists_init+0x1b9) [0xb6eebd59]
/usr/local/mysql/lib/mysql/plugin/ha_innodb.so [0xb6ee2db4]
/usr/local/mysql/lib/mysql/plugin/ha_innodb.so(trx_rseg_list_and_array_init+0xa1) [0xb6ee2fe1]
/usr/local/mysql/lib/mysql/plugin/ha_innodb.so(trx_sys_init_at_db_start+0x171) [0xb6ee3e51]
/usr/local/mysql/lib/mysql/plugin/ha_innodb.so(innobase_start_or_create_for_mysql+0x119d) [0xb6ed53fd]
/usr/local/mysql/lib/mysql/plugin/ha_innodb.so [0xb6eef1df]
/usr/local/mysql/libexec/mysqld(ha_initialize_handlerton(st_plugin_int*)+0x34) [0x82b3ad4]
/usr/local/mysql/libexec/mysqld [0x83347cf]
/usr/local/mysql/libexec/mysqld(plugin_init(int*, char**, int)+0x836) [0x8337a36]
/usr/local/mysql/libexec/mysqld [0x81bce73]
/usr/local/mysql/libexec/mysqld(main+0x495) [0x81c0615]
/lib/libc.so.6(__libc_start_main+0xdc) [0x4c5cddec]
/usr/local/mysql/libexec/mysqld [0x80fb691]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
120920 16:41:25 mysqld_safe mysqld from pid file /usr/local/mysql/var/mysql-test-woody.pid ended请教高人指点下

解决方案 »

  1.   

    检查一下你的 my.cnf 中的内容,特别是 datadir 
      

  2.   

    [mysqld2]
    socket     = /tmp/mysql.sock2
    port       = 3309
    pid-file   = /usr/local/mysql/var1/hostname.pid2
    datadir    = /usr/local/mysql/var1
    # language   = /usr/local/share/mysql/english
    user       = root
    # log=/usr/local/mysql/var1/db-app1.log
    # The MySQL server
    [mysqld1]
    port            = 3306
    socket          = /tmp/mysql.sock
    skip-external-locking
    basedir= /usr/local/mysql/
    datadir= /usr/local/mysql/var/
    pid-file = /usr/local/mysql/var/mysql.pid
    key_buffer_size = 16M
    net_buffer_length =1048576
    max_allowed_packet =50M#table_open_cache =524288
    #sort_buffer_size = 2M
    # net_buffer_length = 2M
    #read_buffer_size = 2M
    #read_rnd_buffer_size = 2M
    #myisam_sort_buffer_size = 2M
    character_set_server=utf8
    log-bin=mysql-bin
    #loose-local-infile=1
    log-bin-index =/usr/local/mysql/var/mysql-bin.index
    log-error = /usr/local/mysql/var/mysql.errinnodb_data_home_dir = /usr/local/mysql/var/
    innodb_data_file_path =ibdata1:100M;ibdata2:20M:autoextend
    innodb_log_group_home_dir = /usr/local/mysql/var/
    innodb_log_files_in_group=2
    # You can set .._buffer_pool_size up to 50 - 80 %
    # of RAM but beware of setting memory usage too high
    innodb_buffer_pool_size =50M
    innodb_additional_mem_pool_size = 2M
    # Set .._log_file_size to 25 % of buffer pool size
    innodb_log_file_size = 50M
    innodb_log_buffer_size = 10M
    innodb_flush_log_at_trx_commit = 1
    innodb_lock_wait_timeout = 50var1是新配置上的端口 
    var目录下 
    [sunny.zhao@mysql-test var]$ ls -lah
    total 1.5G
    drwxr-xr-x 22 mysql mysql 4.0K Sep 20 16:51 .
    drwxr-xr-x 13 mysql mysql 4.0K Sep 18 09:09 ..
    drwxr-xr-x  2 mysql mysql 4.0K Apr  2  2010 account
    drwxrwxrwx  2 root  root  4.0K Sep  5 13:59 bak
    drwxr-xr-x  7 mysql mysql 4.0K Aug 14 08:54 cache
    drwxr-xr-x  2 root  root  4.0K Feb 23  2012 cvs
    drwxr-xr-x  3 mysql mysql 4.0K Apr  2  2010 db
    drwx------  2 mysql mysql 4.0K Sep 20 15:42 DBA_DEMO
    drwxr-xr-x  3 mysql mysql 4.0K Apr  2  2010 empty
    -rw-rw----  1 mysql mysql  50M Sep 20 15:49 ibdata1
    -rw-rw----  1 mysql mysql 1.4G Sep 20 15:49 ibdata2
    -rw-rw----  1 mysql mysql 5.0M Sep 20 16:51 ib_logfile0
    -rw-rw----  1 mysql mysql 5.0M Sep 20 16:36 ib_logfile1
    drwxr-xr-x 17 mysql mysql 4.0K Aug  9 09:40 lib
    drwxr-xr-x  2 mysql mysql 4.0K Mar 30  2007 local
    drwxrwxr-x  5 mysql mysql 4.0K Aug 23 04:02 lock
    drwxr-xr-x  9 mysql mysql 4.0K Aug 23 04:02 log
    lrwxrwxrwx  1 mysql mysql   10 Aug 23 16:47 mail -> spool/mail
    -rw-rw----  1 mysql mysql   51 Sep 19 10:16 master.info
    drwx------  2 mysql mysql 4.0K Jul 23 10:27 mysql
    -rw-rw----  1 mysql mysql  583 Sep  6 11:52 mysql-bin.000059
    -rw-rw----  1 mysql mysql 1.1K Sep  7 15:51 mysql-bin.000060
    -rw-rw----  1 mysql mysql 6.7K Sep 18 09:12 mysql-bin.000061
    -rw-rw----  1 mysql mysql  106 Sep 18 11:02 mysql-bin.000062
    -rw-rw----  1 mysql mysql  106 Sep 19 09:02 mysql-bin.000063
    -rw-rw----  1 mysql mysql  106 Sep 19 09:02 mysql-bin.000064
    -rw-rw----  1 mysql mysql  125 Sep 19 09:03 mysql-bin.000065
    -rw-rw----  1 mysql mysql  125 Sep 19 09:21 mysql-bin.000066
    -rw-rw----  1 mysql mysql  125 Sep 19 09:23 mysql-bin.000067
    -rw-rw----  1 mysql mysql  125 Sep 19 09:43 mysql-bin.000068
    -rw-rw----  1 mysql mysql  125 Sep 19 09:49 mysql-bin.000069
    -rw-rw----  1 mysql mysql 1.8K Sep 20 15:49 mysql-bin.000070
    -rw-rw----  1 mysql mysql  228 Sep 19 10:16 mysql-bin.index
    -rw-rw----  1 mysql mysql 937K Sep 20 15:49 mysql.err
    -rw-rw----  1 mysql mysql 125K Sep 19 09:49 mysql.log
    -rw-rw----  1 mysql mysql  155 Sep  7 15:51 mysql-relay-bin.000001
    -rw-rw----  1 mysql mysql  125 Sep 18 09:12 mysql-relay-bin.000002
    -rw-rw----  1 mysql mysql  106 Sep 18 11:02 mysql-relay-bin.000003
    -rw-rw----  1 mysql mysql  106 Sep 19 09:02 mysql-relay-bin.000004
    -rw-rw----  1 mysql mysql  106 Sep 19 09:02 mysql-relay-bin.000005
    -rw-rw----  1 mysql mysql  125 Sep 19 09:03 mysql-relay-bin.000006
    -rw-rw----  1 mysql mysql  125 Sep 19 09:21 mysql-relay-bin.000007
    -rw-rw----  1 mysql mysql  125 Sep 19 09:23 mysql-relay-bin.000008
    -rw-rw----  1 mysql mysql  125 Sep 19 09:43 mysql-relay-bin.000009
    -rw-rw----  1 mysql mysql  125 Sep 19 09:49 mysql-relay-bin.000010
    -rw-rw----  1 mysql mysql  125 Sep 20 15:49 mysql-relay-bin.000011
    -rw-rw----  1 mysql mysql  275 Sep 19 10:16 mysql-relay-bin.index
    -rw-rw----  1 mysql root   77K Sep 20 16:51 mysql-test-woody.err
    -rw-rw----  1 mysql mysql  540 Sep 20 16:10 mysql-test-woody-relay-bin.index
    drwx------  2 mysql mysql  20K Sep  4 13:53 PIXOS_DB_UAT_DATA
    drwxr-xr-x  2 mysql mysql 4.0K Mar 30  2007 preserve
    drwxr-xr-x  2 mysql mysql 4.0K Jan 10  2007 racoon
    -rw-rw----  1 mysql mysql   30 Sep 19 10:16 relay-log.info
    drwxr-xr-x 16 mysql mysql 4.0K Aug 23 16:09 run
    -rw-rw----  1 mysql mysql  42K Sep 19 09:21 slowquery.log
    drwxr-xr-x 12 mysql mysql 4.0K Apr  2  2010 spool
    drwx------  2 mysql mysql 4.0K Aug 27 15:56 test
    drwxrwxrwt  2 mysql mysql 4.0K Aug 20 17:10 tmp是ibdata文件太大 吗 
    我看Error log中有 
    InnoDB: space name ./ibdata1,
    InnoDB: which is outside the tablespace bounds.
      

  3.   

    corruption in the InnoDB tablespace
      

  4.   

    我之前测试innodb_locks_unsafe_for_binlog 对间隙锁的影响 默认为OFF
    我到my.cnf下设置为1 重启mysql后 发现innodb参数均不见了 show engine 发现 innodb引擎没有了
    然后回到my.cnf将innodb_locks_unsafe_for_binlog参数的设置删掉
    后进入mysql 仍然没有innodb
    然后我重新安装INSTALL PLUGIN InnoDB SONAME 'ha_innodb.so';报错1123我到mysql/var/目录下(在网上看到一帖子安装innodb前要删除掉ib_logfile0和ib_logfile1 )于是删掉 ib_logfile0 和ib_logfile1  然后重启mysql 发现mysql启动不了了
    Errorlog 全部:
    120921 09:39:09 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
    120921  9:39:09  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
    InnoDB: Setting log file ./ib_logfile0 size to 5 MB
    InnoDB: Database physically writes the file full: wait...
    120921  9:39:09  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
    InnoDB: Setting log file ./ib_logfile1 size to 5 MB
    InnoDB: Database physically writes the file full: wait...
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    120921  9:39:10  InnoDB: Database was not shut down normally!
    InnoDB: Starting crash recovery.
    InnoDB: Reading tablespace information from the .ibd files...
    InnoDB: Restoring possible half-written data pages from the doublewrite
    InnoDB: buffer...
    InnoDB: Warning: a page in the doublewrite buffer is not within space
    InnoDB: bounds; space id 0 page number 16399, page 3 in doublewrite buf.
    InnoDB: Warning: a page in the doublewrite buffer is not within space
    InnoDB: bounds; space id 0 page number 90000, page 16 in doublewrite buf.
    InnoDB: Warning: a page in the doublewrite buffer is not within space
    ..
    ...
    很多行
    ....
    ...
    InnoDB: bounds; space id 0 page number 89973, page 117 in doublewrite buf.
    InnoDB: Warning: a page in the doublewrite buffer is not within space
    InnoDB: bounds; space id 0 page number 89974, page 118 in doublewrite buf.
    InnoDB: Warning: a page in the doublewrite buffer is not within space
    InnoDB: bounds; space id 0 page number 89975, page 119 in doublewrite buf.
    InnoDB: Warning: a page in the doublewrite buffer is not within space
    InnoDB: bounds; space id 0 page number 89976, page 120 in doublewrite buf.
    InnoDB: Warning: a page in the doublewrite buffer is not within space
    InnoDB: bounds; space id 0 page number 89977, page 121 in doublewrite buf.
    InnoDB: Warning: a page in the doublewrite buffer is not within space
    InnoDB: bounds; space id 0 page number 89978, page 122 in doublewrite buf.
    InnoDB: Warning: a page in the doublewrite buffer is not within space
    InnoDB: bounds; space id 0 page number 89979, page 123 in doublewrite buf.
    InnoDB: Warning: a page in the doublewrite buffer is not within space
    InnoDB: bounds; space id 0 page number 89980, page 124 in doublewrite buf.
    InnoDB: Warning: a page in the doublewrite buffer is not within space
    InnoDB: bounds; space id 0 page number 89981, page 125 in doublewrite buf.
    InnoDB: Warning: a page in the doublewrite buffer is not within space
    InnoDB: bounds; space id 0 page number 89982, page 126 in doublewrite buf.
    InnoDB: Warning: a page in the doublewrite buffer is not within space
    InnoDB: bounds; space id 0 page number 89983, page 127 in doublewrite buf.
    InnoDB: Error: trying to access page number 13199 in space 0,
    InnoDB: space name ./ibdata1,
    InnoDB: which is outside the tablespace bounds.
    InnoDB: Byte offset 0, len 16384, i/o type 10.
    InnoDB: If you get this error at mysqld startup, please check that
    InnoDB: your my.cnf matches the ibdata files that you have in the
    InnoDB: MySQL server.
    120921  9:39:10  InnoDB: Assertion failure in thread 3086780112 in file fil/fil0fil.c line 4123
    InnoDB: We intentionally generate a memory trap.
    InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
    InnoDB: If you get repeated assertion failures or crashes, even
    InnoDB: immediately after the mysqld startup, there may be
    InnoDB: corruption in the InnoDB tablespace. Please refer to
    InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html
    InnoDB: about forcing recovery.
    120921  9:39:10 - mysqld got signal 6 ;
    This could be because you hit a bug. It is also possible that this binary
    or one of the libraries it was linked against is corrupt, improperly built,
    or misconfigured. This error can also be caused by malfunctioning hardware.
    We will try our best to scrape up some info that will hopefully help diagnose
    the problem, but since we have already crashed, something is definitely wrong
    and this may fail.key_buffer_size=8384512
    read_buffer_size=131072
    max_used_connections=0
    max_threads=151
    threads_connected=0
    It is possible that mysqld could use up to
    key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 337730 K
    bytes of memory
    Hope that's ok; if not, decrease some variables in the equation.thd: 0x0
    Attempting backtrace. You can use the following information to find out
    where mysqld died. If you see no messages after this, something went
    terribly wrong...
    stack_bottom = (nil) thread_stack 0x30000
    /usr/local/mysql/libexec/mysqld(my_print_stacktrace+0x22) [0x839cf62]
    /usr/local/mysql/libexec/mysqld(handle_segfault+0x37f) [0x81bb54f]
    [0xb7fd5400]
    /lib/libc.so.6(abort+0x101) [0x4c5e2451]
    /usr/local/mysql/lib/mysql/plugin/ha_innodb.so(fil_io+0x39c) [0xb6f0881c]
    /usr/local/mysql/lib/mysql/plugin/ha_innodb.so [0xb6eecca4]
    /usr/local/mysql/lib/mysql/plugin/ha_innodb.so(buf_read_page+0x273) [0xb6eed223]
    /usr/local/mysql/lib/mysql/plugin/ha_innodb.so(buf_page_get_gen+0x114) [0xb6ee5994]
    /usr/local/mysql/lib/mysql/plugin/ha_innodb.so(trx_undo_lists_init+0x1b9) [0xb6f8bd59]
    /usr/local/mysql/lib/mysql/plugin/ha_innodb.so [0xb6f82db4]
    /usr/local/mysql/lib/mysql/plugin/ha_innodb.so(trx_rseg_list_and_array_init+0xa1) [0xb6f82fe1]
    /usr/local/mysql/lib/mysql/plugin/ha_innodb.so(trx_sys_init_at_db_start+0x171) [0xb6f83e51]
    /usr/local/mysql/lib/mysql/plugin/ha_innodb.so(innobase_start_or_create_for_mysql+0x119d) [0xb6f753fd]
    /usr/local/mysql/lib/mysql/plugin/ha_innodb.so [0xb6f8f1df]
    /usr/local/mysql/libexec/mysqld(ha_initialize_handlerton(st_plugin_int*)+0x34) [0x82b3ad4]
    /usr/local/mysql/libexec/mysqld [0x83347cf]
    /usr/local/mysql/libexec/mysqld(plugin_init(int*, char**, int)+0x836) [0x8337a36]
    /usr/local/mysql/libexec/mysqld [0x81bce73]
    /usr/local/mysql/libexec/mysqld(main+0x495) [0x81c0615]
    /lib/libc.so.6(__libc_start_main+0xdc) [0x4c5cddec]
    /usr/local/mysql/libexec/mysqld [0x80fb691]
    The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
    information that should help you find out what is causing the crash.
    120921 09:39:10 mysqld_safe mysqld from pid file /usr/local/mysql/var/mysql-test-woody.pid ended看Error log的内容是删除ib_logfile0和ib_logfile1所导致的
    请教大家 
    删除了ib_logfile0和ib_logfile1 还能恢复吗
    如何恢复?
      

  5.   

    用磁盘恢复之类的软件试试,如果没有数据,删除ibdata1,重新启动时会建立ibdata1、ib_logfile*.*
      

  6.   

    [mysqld1]为什么改成这个而不是 [mysqld]
      

  7.   

    配置了两个实例  这个是端口为3306 的 
    另外的那个mysql是启动项为[mysql2]端口3309 这个是正常的 没有受到影响 数据目录不同
      

  8.   


    sudo mysqld_multi --defaults-extra-file=/etc/my.cnf start 1之前的操作已经在4楼描述过了啊