XAMPP: MySQL not starting - mysql

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?

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.
Stop Mysql service from xampp control panel or stop it manually from services.msc and quit the xampp control panel.
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)
Restart Mysql service manually from services.msc
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.

Related

Mysql failed to start due to errors from innodb

I am trying to run MySql on my Virtual Machine. However, I encountered the following error and thus MySql cannot start up. I am new to MySql. Your help is really appreciated! Here is the message from the error log:
[Note] Plugin 'FEDERATED' is disabled.
/opt/mysql/mysql/sbin/mysqld: Table 'mysql.plugin' doesn't exist
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
[Note] InnoDB: Using atomics to ref count buffer pool pages
[Note] InnoDB: The InnoDB memory heap is disabled
[Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
[Note] InnoDB: Memory barrier is not used
[Note] InnoDB: Compressed tables use zlib 1.2.3
[Note] InnoDB: Using Linux native AIO
[Note] InnoDB: Using CPU crc32 instructions
[Note] InnoDB: Initializing buffer pool, size = 128.0M
[Note] InnoDB: Completed initialization of buffer pool
[Note] InnoDB: Restoring page 0 of tablespace 0
[Warning] InnoDB: Doublewrite does not have page_no=0 of space: 0
[ERROR] InnoDB: space header page consists of zero bytes in data file ./ibdata1
[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!
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting
/opt/mysql/mysql/sbin/mysqld: Table 'mysql.plugin' doesn't exist
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
IF you read in carefully, first line enlightens the problem and the second line advises solution for it.
run mysql_upgrade to fix it.
Seems, you didn't set path of your ibdata1 or you removed ibdata1 file. Please check my.cnf and set below parameter in my.cnf.
innodb_data_home_dir (path of innodb)
innodb_data_file_path (for example: ibdata1:10M:autoextend)
Note: If it's new setup then also enable innodb_file_per_table

Error: MySQL shutdown unexpectedly - XAMPP

I have trouble running mysql using xampp on a win10 machine.
Here is the xampp message:
Error: MySQL shutdown unexpectedly.
1:33:01 [mysql] This may be due to a blocked port, missing dependencies,
1:33:01 [mysql] improper privileges, a crash, or a shutdown by another method.
1:33:01 [mysql] Press the Logs button to view error logs and check
1:33:01 [mysql] the Windows Event Viewer for more clues
1:33:01 [mysql] If you need more help, copy and post this
1:33:01 [mysql] entire log window on the forums
And this is my mysql.log:
017-10-18 03:52:49 efc 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.
2017-10-18 3:52:49 3836 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.
2017-10-18 3:52:49 3836 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2017-10-18 3:52:49 3836 [Note] InnoDB: The InnoDB memory heap is disabled
2017-10-18 3:52:49 3836 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2017-10-18 3:52:49 3836 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
2017-10-18 3:52:49 3836 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-10-18 3:52:49 3836 [Note] InnoDB: Using generic crc32 instructions
2017-10-18 3:52:49 3836 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2017-10-18 3:52:49 3836 [Note] InnoDB: Completed initialization of buffer pool
2017-10-18 3:52:49 3836 [Note] InnoDB: Restoring page 0 of tablespace 0
2017-10-18 3:52:49 3836 [Warning] InnoDB: Doublewrite does not have page_no=0 of space: 0
2017-10-18 3:52:49 3836 [ERROR] InnoDB: space header page consists of zero bytes in data file C:\xampp\mysql\data\ibdata1
2017-10-18 3:52:49 3836 [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!
2017-10-18 3:52:49 3836 [ERROR] Plugin 'InnoDB' init function returned error.
2017-10-18 3:52:49 3836 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-10-18 3:52:49 3836 [Note] Plugin 'FEEDBACK' is disabled.
2017-10-18 3:52:49 3836 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-10-18 3:52:49 3836 [ERROR] Aborting
I have tried reinitilizing mysql data folder, deleting ibdata1, ib_log files from it, without any success.
Any suggestions are much appreciated.
Solved by Install 5.6.35 / PHP 5.6.35 - XAMPP
Have same issue by using windows 10, xampp 7.2.2.
took backup of htdocs projects
uninstalled XAMPP 7.2.x
installed XAMPP 5.6.x
pasted backup projects to htdocs
got Apache port number issue, then change 80 to 8080 in httpd.conf
works fine !
XAMPP MySQL is not running
Solution->
1.Open cmd and type 'services.msc'
2.Service panel will be opened within 5 seconds
3.Now search for anyother sql server which is still running
4.Select all the sql servers and stop them one by one service(There could be more than one)
5.Finally refresh your computer and start MySQL
6.Enjoy
Hope it will run successfully now :=)

MySQL has broke, can not be started: "Restoring possible half-written data pages from the doublewrite buffer..."

When attempting to start the mysql server, it returns with exit code 1. I've done this a million times before on this server. Without messing with the server in the past month, mysql has suddenly stopped and I can not start it. My error.log:
[Note] InnoDB: Using mutexes to ref count buffer pool pages
[Note] InnoDB: The InnoDB memory heap is disabled
[Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
[Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
[Note] InnoDB: Compressed tables use zlib 1.2.8
[Note] InnoDB: Using Linux native AIO
[Note] InnoDB: Using SSE crc32 instructions
[Note] InnoDB: Initializing buffer pool, size = 128.0M
[Note] InnoDB: Completed initialization of buffer pool
[Note] InnoDB: Highest supported file format is Barracuda.
[Note] InnoDB: Starting crash recovery from checkpoint LSN=591771482442
Everything goes to ruin below this line.
[Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer...
InnoDB: Set innodb_force_recovery to ignore this error.
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[Note] Plugin 'FEEDBACK' is disabled.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting
Until I can start mysql-server, I can not run mysqldump nor mysql -u root:
Got error: 2002: "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")" when trying to connect
I'm running mariadb-server 10.1.23-9-deb9u1.
Not sure if this will work but since the server doesn't work anyway so try this out:
Rename logfile0 and logfile1 and then restart the server.
Before doing anything, make a copy of the entire mysql folder to another location just in case.
The answer was right infront of me:
InnoDB: Set innodb_force_recovery to ignore this error.
I set innodb_force_recovery = 1 after the [mysqld] clause in my /etc/mysql/mariadb.conf.d/50-server.cnf (This file may very depending on your OS).
I restarted it and it repaired itself. I later took out the innodb_force_recovery = 1 and restarted again, it then worked just fine.
What did I learn? Have more faith in "auto-repair" procedures. My expectations were so low for them because of my exposure to Microsoft Windows.

Error in MySQL Xampp

I have installed MySQL Workbench on my computer that is using port 3306.
I installed Xampp apache server. When I start the services this error appears:
Problem detected!
Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" --defaults- ile="C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" MySQL56"! MySQL WILL NOT start without the configured ports free!
You need to uninstall/disable/reconfigure the blocking application or reconfigure MySQL and the Control Panel to listen on a different port
I changed the mysql port for xampp in the following way:
Stop the xampp server, if it is already running.
Edit the value to "port" in xampp/mysql/bin/my.ini
Code:
Password = your_password
port = 3306 ---> 3307
socket = "/ xampp / mysql / mysql.sock"
and here also
Code:
The MySQL server
[ mysqld ]
port = 3306 ---> 3307
socket = "/ xampp / mysql / mysql.sock"
And Started mysql service however the error remains.
Does someone can help me solve this please?
thank you all
best regards
----------------------------MySQL_error.log---------------------------
140818 12:09:30 [Note] Plugin 'FEDERATED' is disabled.
140818 12:09:30 InnoDB: The InnoDB memory heap is disabled
140818 12:09:30 InnoDB: Mutexes and rw_locks use Windows interlocked functions
140818 12:09:30 InnoDB: Compressed tables use zlib 1.2.3
140818 12:09:30 InnoDB: Initializing buffer pool, size = 16.0M
140818 12:09:30 InnoDB: Completed initialization of buffer pool
InnoDB: Error: space header page consists of zero bytes in data file C:\xampp\mysql\data\ibdata1
140818 12:09:30 InnoDB: Could not open or create data files.
140818 12:09:30 InnoDB: If you tried to add new data files, and it failed here,
140818 12:09:30 InnoDB: you should now edit innodb_data_file_path in my.cnf back
140818 12:09:30 InnoDB: to what it was, and remove the new ibdata files InnoDB created
140818 12:09:30 InnoDB: in this failed attempt. InnoDB only wrote those files full of
140818 12:09:30 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
140818 12:09:30 InnoDB: remove old data files which contain your precious data!
140818 12:09:30 [ERROR] Plugin 'InnoDB' init function returned error.
140818 12:09:30 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140818 12:09:30 [ERROR] Unknown/unsupported storage engine: InnoDB
140818 12:09:30 [ERROR] Aborting
140818 12:09:30 [Note] c:\xampp\mysql\bin\mysqld.exe: Shutdown complete
140818 12:21:45 [Note] Plugin 'FEDERATED' is disabled.
140818 12:21:45 InnoDB: The InnoDB memory heap is disabled
140818 12:21:45 InnoDB: Mutexes and rw_locks use Windows interlocked functions
140818 12:21:45 InnoDB: Compressed tables use zlib 1.2.3
140818 12:21:45 InnoDB: Initializing buffer pool, size = 16.0M
140818 12:21:45 InnoDB: Completed initialization of buffer pool
InnoDB: Error: space header page consists of zero bytes in data file C:\xampp\mysql\data\ibdata1
140818 12:21:45 InnoDB: Could not open or create data files.
140818 12:21:45 InnoDB: If you tried to add new data files, and it failed here,
140818 12:21:45 InnoDB: you should now edit innodb_data_file_path in my.cnf back
140818 12:21:45 InnoDB: to what it was, and remove the new ibdata files InnoDB created
140818 12:21:45 InnoDB: in this failed attempt. InnoDB only wrote those files full of
140818 12:21:45 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
140818 12:21:45 InnoDB: remove old data files which contain your precious data!
140818 12:21:45 [ERROR] Plugin 'InnoDB' init function returned error.
140818 12:21:45 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140818 12:21:45 [ERROR] Unknown/unsupported storage engine: InnoDB
140818 12:21:45 [ERROR] Aborting
This sounds a lot like you got two MySQL servers running at the same time. I suggest you check your process list for a process called mysqld.exe. (You can also check the "Netstat" as provided by Control Panel) This should be your already running instance of MySQL Server. End that one however you like and try again.
In your case I'd also consider installing the MySQL server as windows-service. This allows you to "externally" manage the server and make sure you only have one instance running.
You can accomplish that by clicking the red x beside the Modulename and wait for it to turn into a green checkmark.
After that your Control Panel should looks something like that ▲▲
I installed both MySQL and Apache as service, but that's your preference ;)
You can then configure your MySQL Workbench to access your already running server instead of starting up its own.
You shouldn't be required to change the port of MySQL in any case.
In addition to that, your Apache Module should be able to launch even without MySQL started...

MySQL service wont start on XAMPP

I installed MySQL Server 5.6, but soon after I had to install XAMPP.
When I try to start MySQL it just hangs at...
Attempting to start MySQL app...
The errors in the logs are as follows...
140401 15:05:43 [Note] Plugin 'FEDERATED' is disabled.
140401 15:05:43 InnoDB: The InnoDB memory heap is disabled
140401 15:05:43 InnoDB: Mutexes and rw_locks use Windows interlocked functions
140401 15:05:43 InnoDB: Compressed tables use zlib 1.2.3
140401 15:05:43 InnoDB: Initializing buffer pool, size = 16.0M
140401 15:05:43 InnoDB: Completed initialization of buffer pool
InnoDB: Error: space header page consists of zero bytes in data file C:\xampp\mysql\data\ibdata1
140401 15:05:43 InnoDB: Could not open or create data files.
140401 15:05:43 InnoDB: If you tried to add new data files, and it failed here,
140401 15:05:43 InnoDB: you should now edit innodb_data_file_path in my.cnf back
140401 15:05:43 InnoDB: to what it was, and remove the new ibdata files InnoDB created
140401 15:05:43 InnoDB: in this failed attempt. InnoDB only wrote those files full of
140401 15:05:43 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
140401 15:05:43 InnoDB: remove old data files which contain your precious data!
140401 15:05:43 [ERROR] Plugin 'InnoDB' init function returned error.
140401 15:05:43 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140401 15:05:43 [ERROR] Unknown/unsupported storage engine: InnoDB
140401 15:05:43 [ERROR] Aborting
140401 15:05:43 [Note] c:\xampp\mysql\bin\mysqld.exe: Shutdown complete
I tried stopping the MySQL56 service in services, but still it didnt work
I also tried changing ports in my.ini to 3307, but still no luck
I have obviously restarted everything after these changes but it just stays hanging on the attempt to start
Uninstall both and reinstall XAMPP with MySQL included. Many times these installs will run as administrators and then you won't have rights to modify them if it sees you as a different user.
You could also try right clicking on the icon to start XAMPP and choose "Run as Administrator" before uninstall / reinstall and see if that solves it.