我有 2 个 mysql 服务器。我们称它们为server01 和 server02。两者的配置相同:mysqladmin Ver 8.42 Distrib 5.1.61,适用于 x86_64 上的 redhat-linux-gnu
[client]
default-character-set=utf8
[mysqld]
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
max_allowed_packet = 16M
default-character-set=utf8
default-collation=utf8_unicode_ci
character-set-server=utf8
collation-server=utf8_unicode_ci
default-storage-engine = InnoDB
innodb_data_home_dir = /var/lib/mysql
innodb_log_group_home_dir = /var/lib/mysql
innodb_data_file_path = ibdata1:10M:autoextend
innodb_additional_mem_pool_size = 2M
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_lock_wait_timeout = 50
innodb_flush_log_at_trx_commit = 1
innodb_buffer_pool_size = 700M
table_cache = 300
thread_cache_size = 4
query_cache_size = 200m
query_cache_limit = 10m
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
我在server01上做了一个mysqldump:mysqldump -uuser -ppassword --all-databases > testservers.sql
(这些数据库中的大多数表都是 innodb,一些 mysql.* 表也是 Innodb)
然后我在server02上导入testservers.sql:mysql -uuser < 测试服务器.sql
(mysqld 已经使用--skip-network 启动)。
到目前为止一切顺利,我可以登录 mysql,一切似乎都正常。但是当我退出到 shell 并执行服务 mysqld 重启,服务启动失败。
/var/log/mysqld.log 中的堆栈跟踪:
121022 14:53:19 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
121022 14:53:19 [Warning] '--default-character-set' is deprecated and will be removed in a future release. Please use '--character-set-server' instead.
121022 14:53:19 [Warning] '--default-collation' is deprecated and will be removed in a future release. Please use '--collation-server' instead.
12:53:19 UTC - mysqld got signal 11 ;
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
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 338324 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x267e630
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 = 7fff3efe0be0 thread_stack 0x40000
/usr/libexec/mysqld(my_print_stacktrace+0x29) [0x84bd89]
/usr/libexec/mysqld(handle_fatal_signal+0x483) [0x6a0be3]
/lib64/libpthread.so.0() [0x338d60f500]
/usr/libexec/mysqld(ha_resolve_by_name(THD*, st_mysql_lex_string const*)+0x81) [0x6956e1]
/usr/libexec/mysqld(open_table_def(THD*, st_table_share*, unsigned int)+0xe0a) [0x60e5ba]
/usr/libexec/mysqld(get_table_share(THD*, TABLE_LIST*, char*, unsigned int, unsigned int, int*)+0x20b) [0x602b0b]
/usr/libexec/mysqld() [0x603597]
/usr/libexec/mysqld(open_table(THD*, TABLE_LIST*, st_mem_root*, bool*, unsigned int)+0x7a1) [0x6079a1]
/usr/libexec/mysqld(open_tables(THD*, TABLE_LIST**, unsigned int*, unsigned int)+0x5d0) [0x608570]
/usr/libexec/mysqld(open_and_lock_tables_derived(THD*, TABLE_LIST*, bool)+0x6a) [0x60877a]
/usr/libexec/mysqld(plugin_init(int*, char**, int)+0x622) [0x715af2]
/usr/libexec/mysqld() [0x5bd3b2]
/usr/libexec/mysqld(main+0x1b3) [0x5bfc93]
/lib64/libc.so.6(__libc_start_main+0xfd) [0x338d21ecdd]
/usr/libexec/mysqld() [0x5087b9]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0): is an invalid pointer
Connection ID (thread ID): 0
Status: NOT_KILLED
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.
121022 14:53:19 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
典型的 mysqdump 条目如下所示:
DROP TABLE IF EXISTS `adodb_logsql`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `adodb_logsql` (
`id` bigint(10) unsigned NOT NULL AUTO_INCREMENT,
`created` datetime NOT NULL,
`sql0` varchar(250) NOT NULL DEFAULT '',
`sql1` text,
`params` text,
`tracer` text,
`timer` decimal(16,6) NOT NULL DEFAULT '0.000000',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='to save some logs from ADOdb';
/*!40101 SET character_set_client = @saved_cs_client */;
如果我在导入之前将所有出现的“ENGINE = InnoDB”更改为“ENGINE = MyISAM”,则服务重新启动没有问题。我对正在发生的事情感到十分困惑,也许我只是个白痴,那么请一定要告诉我。
任何帮助将不胜感激!