0

I am having a major problem starting mysql (using mariadb).

I had a server crash (and didn't have a dump of the databases in the server.

After restoring the server, I tried to manually copy the databases from the old to the new data-directory.

But when trying to access the databases, or generate a dump, or whatever, I got messages that said that the table doesn't exist.

Looking through, I realised that it had to do with the InnoDB ib* files (which I had not copied over.

I made a copy of my "new" data directory on another partition, and then moved the entire old data directory in its place.

I restarted mariadb with the service command and it said that it started fine.

But when I tried to connect, I would get the error Got error: 2002: "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2 "No such file or directory")" when trying to connect

I decided I wanted to see what the errors were, and issued the command mysqld to view the startup process and see any errors.

Below is the output. I don't know what the problem is.

$ mysqld
2017-05-09 22:45:15 140736651862976 [Note] mysqld (mysqld 10.1.23-MariaDB) starting as process 53227 ...
2017-05-09 22:45:15 140736651862976 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2017-05-09 22:45:15 140736651862976 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2017-05-09 22:45:15 140736651862976 [Note] InnoDB: The InnoDB memory heap is disabled
2017-05-09 22:45:15 140736651862976 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-05-09 22:45:15 140736651862976 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-05-09 22:45:15 140736651862976 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-05-09 22:45:15 140736651862976 [Note] InnoDB: Using SSE crc32 instructions
2017-05-09 22:45:15 140736651862976 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-05-09 22:45:15 140736651862976 [Note] InnoDB: Completed initialization of buffer pool
2017-05-09 22:45:15 140736651862976 [Note] InnoDB: Highest supported file format is Barracuda.
2017-05-09 22:45:15 140736651862976 [Note] InnoDB: The log sequence numbers 40443083550 and 40443083550 in ibdata files do not match the log sequence number 40443083788 in the ib_logfiles!
2017-05-09 22:45:31 140736651862976 [Note] InnoDB: Processed 3542 .ibd/.isl files
2017-05-09 22:45:34 140736651862976 [Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer...
2017-05-09 22:45:34 140736651862976 [Note] InnoDB: Read redo log up to LSN=40443084288
InnoDB: wrong number of columns in SYS_INDEXES record
InnoDB: wrong number of columns in SYS_INDEXES record
InnoDB: wrong number of columns in SYS_INDEXES record
InnoDB: wrong number of columns in SYS_INDEXES record
InnoDB: wrong number of columns in SYS_INDEXES record
InnoDB: wrong number of columns in SYS_INDEXES record
2017-05-09 22:45:34 140736651862976 [Note] InnoDB: Creating tablespace and datafile system tables.
2017-05-09 22:45:34 140736651862976 [ERROR] InnoDB: Creation of SYS_TABLESPACES and SYS_DATAFILES has failed with error 18.  Tablespace is full. Dropping incompletely created tables.
2017-05-09 22:45:34 7fffce2423c0  InnoDB: Assertion failure in thread 140736651862976 in file dict0crea.cc line 1903
InnoDB: Failing assertion: err == DB_OUT_OF_FILE_SPACE || err == DB_TOO_MANY_CONCURRENT_TRXS
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.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
170509 22:45:34 [ERROR] 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.

To report this bug, see https://mariadb.com/kb/en/reporting-bugs

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.

Server version: 10.1.23-MariaDB
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=0
max_threads=153
thread_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467121 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 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 = 0x0 thread_stack 0x48400
0   mysqld                              0x0000000105ed1304 my_print_stacktrace + 60
0   mysqld                              0x00000001059cd5d8 handle_fatal_signal + 684
0   libsystem_platform.dylib            0x00007fffc54edb3a _sigtramp + 26
0   libsystem_notify.dylib              0x00007fffc54e7285 registration_node_release + 40
0   libsystem_c.dylib                   0x00007fffc5372420 abort + 129
0   mysqld                              0x0000000105d74d3a _Z40dict_create_add_tablespace_to_dictionarymPKcmS0_P5trx_tb + 0
0   mysqld                              0x0000000105e8a956 _Z34innobase_start_or_create_for_mysqlv + 7160
0   mysqld                              0x0000000105de07ed _ZL13innobase_initPv + 2996
0   mysqld                              0x00000001059ce0df _Z24ha_initialize_handlertonP13st_plugin_int + 94
0   mysqld                              0x0000000105b2d074 _ZL17plugin_initializeP11st_mem_rootP13st_plugin_intPiPPcb + 351
0   mysqld                              0x0000000105b2cdba _Z11plugin_initPiPPci + 2881
0   mysqld                              0x0000000105a74766 _ZL22init_server_componentsv + 1790
0   mysqld                              0x0000000105a72c03 _Z11mysqld_mainiPPc + 9583
0   libdyld.dylib                       0x00007fffc52de235 start + 1
0   ???                                 0x0000000000000001 0x0 + 1
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.
[1]    53227 abort      mysqld
$

In answer to Alexander T I did.

I added this to my.cnf:

[mysqld]
innodb_force_recovery = 1

Here's the output:

$ mysql.server start
Starting MySQL
170509 23:26:31 mysqld_safe Logging to '/usr/local/var/mysql/Alis-iMac.local.err'.
.170509 23:26:31 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
................................. ERROR!
$

The command mysqld errors out as well.

Here's the tail:

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 = 0x0 thread_stack 0x48400
0   mysqld                              0x000000010e787304 my_print_stacktrace + 60
0   mysqld                              0x000000010e2835d8 handle_fatal_signal + 684
0   libsystem_platform.dylib            0x00007fffc54edb3a _sigtramp + 26
0   libsystem_notify.dylib              0x00007fffc54e7285 registration_node_release + 40
0   libsystem_c.dylib                   0x00007fffc5372420 abort + 129
0   mysqld                              0x000000010e62ad3a _Z40dict_create_add_tablespace_to_dictionarymPKcmS0_P5trx_tb + 0
0   mysqld                              0x000000010e740956 _Z34innobase_start_or_create_for_mysqlv + 7160
0   mysqld                              0x000000010e6967ed _ZL13innobase_initPv + 2996
0   mysqld                              0x000000010e2840df _Z24ha_initialize_handlertonP13st_plugin_int + 94
0   mysqld                              0x000000010e3e3074 _ZL17plugin_initializeP11st_mem_rootP13st_plugin_intPiPPcb + 351
0   mysqld                              0x000000010e3e2dba _Z11plugin_initPiPPci + 2881
0   mysqld                              0x000000010e32a766 _ZL22init_server_componentsv + 1790
0   mysqld                              0x000000010e328c03 _Z11mysqld_mainiPPc + 9583
0   libdyld.dylib                       0x00007fffc52de235 start + 1
0   ???                                 0x0000000000000001 0x0 + 1
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.
[1]    53630 abort      mysqld

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.