0

I was in the middle of developing my site and both apache and mysql were running normally until suddenly, the database failed to connect. I checked my XAMPP control panel and MySQL had stopped running. I searched for a solution here and some other similar questions on SO but i haven't been able to find a solution that works for me. Here is the contents of mysql_error.log file:

2016-04-15 20:30:18 150c InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
160415 20:30:18 [Note] InnoDB: Using mutexes to ref count buffer pool pages
160415 20:30:18 [Note] InnoDB: The InnoDB memory heap is disabled
160415 20:30:18 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
160415 20:30:18 [Note] InnoDB: Memory barrier is not used
160415 20:30:18 [Note] InnoDB: Compressed tables use zlib 1.2.3
160415 20:30:18 [Note] InnoDB: Not using CPU crc32 instructions
160415 20:30:18 [Note] InnoDB: Initializing buffer pool, size = 16.0M
160415 20:30:18 [Note] InnoDB: Completed initialization of buffer pool
160415 20:30:18 [Note] InnoDB: Restoring page 0 of tablespace 0
160415 20:30:18 [Warning] InnoDB: Doublewrite does not have page_no=0 of space: 0
160415 20:30:18 [ERROR] InnoDB: space header page consists of zero bytes in data file D:\xampp\mysql\data\ibdata1
160415 20:30:18 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
160415 20:30:18 [ERROR] Plugin 'InnoDB' init function returned error.
160415 20:30:18 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160415 20:30:18 [Note] Plugin 'FEEDBACK' is disabled.
160415 20:30:18 [ERROR] Unknown/unsupported storage engine: InnoDB
160415 20:30:18 [ERROR] Aborting

160415 20:30:18 [Note] D:\xampp\mysql\bin\mysqld.exe: Shutdown complete

What i have tried until now:

  • i have changed to port address for from 3306 to 3307, 3310. Didn't work.
  • i deleted ibdata1 file. Although the file reappeared back in its place after i attempted to restart MySQL. (I learnt later that i would lose my tables if ibdata1 is missing. i don't want that.)

Why did MySQL suddenly run into problems and and how to start MySQL without losing my tables?

Community
  • 1
  • 1
user3650571
  • 5
  • 1
  • 7

1 Answers1

0

There are several reason MySql keeps shutting down unexpectedly.

I am assuming that you have not installed multiple mysql server versions in the same machine.

  1. Stop Mysql service from xampp control panel or stop it manually from services.msc and quit the xampp control panel.
  2. Delete these two log files (ib_logfile0 and ib_logfile1) from xampp/mysql/ directory. (Note: I am not sure about the exact path of log files, check in all the folders of xampp/mysql/ directory)
  3. Restart Mysql service manually from services.msc
  4. open xampp control panel, you should see mysql is running.

I also see your innodb_buffer_pool_size is very low.

Increase the buffer_pool_size to about 50-60% of your RAM. For example, If you have 2GB ram, then set buffer_pool_size= 1GB

run this query in mysql.

set innodb_buffer_pool_size=1073741824;

or

set global innodb_buffer_pool_size=1073741824;

restart mysql server.

CST RAIZE
  • 428
  • 1
  • 5
  • 18