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

I have 2 mysql servers. Let's call them server01 & server02. Both have the same configuration: mysqladmin Ver 8.42 Distrib 5.1.61, for redhat-linux-gnu on x86_64

[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

I make a mysqldump on server01: mysqldump -uuser -ppassword --all-databases > testservers.sql
(most tables in these databases are innodb, some of the mysql.* tables are Innodb too)

Then I import the testservers.sql on server02: mysql -uuser < testservers.sql
(mysqld has been started with --skip-network).

So far so good, I can login into mysql & everything seems to be ok. BUT when I exit to the shell and execute service mysqld restart, The service fails to start.

stack-trace in /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

A typical mysqdump entry looks like this:

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 */;

IF I change all occurrences of "ENGINE=InnoDB" to "ENGINE=MyISAM" before import, then the service has no problem restarting. I'm quite puzzled as to what's happening, maybe I'm just an idiot, then by all means tell me so.

Any help would be greatly appreciated!

share|improve this question
    
As your log shows use '--character-set-server' instead. Also does mysql user own /var/lib/mysql? e.g chown -R mysql: /var/lib/mysql. Last question. Why are you running mysql with --skip-grant-tables? –  val0x00ff Oct 24 '12 at 8:56
    
I'm also using character-set-server=utf8 & collation-server=utf8_unicode_ci . So it's just for backward compatibility. Mysql owns everything in that folder including the folder itself. It was a typo the --skip-grant thing. –  ubunut Oct 24 '12 at 10:37
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.