Xampp mysql Error: MySQL shutdown unexpectedly - php

when I starting mysql, giving the following error:
17:43:13 [mysql] Error: MySQL shutdown unexpectedly.
17:43:13 [mysql] This may be due to a blocked port, missing dependencies,
17:43:13 [mysql] improper privileges, a crash, or a shutdown by another method.
17:43:13 [mysql] Press the Logs button to view error logs and check
17:43:13 [mysql] the Windows Event Viewer for more clues
17:43:13 [mysql] If you need more help, copy and post this
17:43:13 [mysql] entire log window on the forums
then, I check the mysql_error.log:
2017-05-03 17:39:39 202c 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.
170503 17:39:39 [Note] InnoDB: Using mutexes to ref count buffer pool pages
170503 17:39:39 [Note] InnoDB: The InnoDB memory heap is disabled
170503 17:39:39 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
170503 17:39:39 [Note] InnoDB: Memory barrier is not used
170503 17:39:39 [Note] InnoDB: Compressed tables use zlib 1.2.3
170503 17:39:39 [Note] InnoDB: Not using CPU crc32 instructions
170503 17:39:39 [Note] InnoDB: Initializing buffer pool, size = 16.0M
170503 17:39:39 [Note] InnoDB: Completed initialization of buffer pool
170503 17:39:39 [Note] InnoDB: Highest supported file format is Barracuda.
170503 17:39:39 [Note] InnoDB: The log sequence numbers 0 and 0 in ibdata files do not match the log sequence number 1600674 in the ib_logfiles!
170503 17:39:39 [Note] InnoDB: Database was not shutdown normally!
170503 17:39:39 [Note] InnoDB: Starting crash recovery.
170503 17:39:39 [Note] InnoDB: Reading tablespace information from the .ibd files...
170503 17:39:39 [Note] InnoDB: Restoring possible half-written data pages
170503 17:39:39 [Note] InnoDB: from the doublewrite buffer...
170503 17:39:39 [Note] InnoDB: 128 rollback segment(s) are active.
170503 17:39:39 [Note] InnoDB: Waiting for purge to start
170503 17:39:40 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.22-72.0 started; log sequence number 1600674
170503 17:39:40 [Note] Plugin 'FEEDBACK' is disabled.
170503 17:39:40 [Note] Server socket created on IP: '::'.
finally, I moved xampp/mysql/backup files into xampp/mysql/data and run mysql again.Then, it worked!But I don't know why.What led to this problem.
Hope someone doubts for me!

I searched on google and tried everything like port changing, delete files, reinstall xampp, copy and paste backup files to mysql/data folder but nothing worked.
I found the best solution to this problem.
Solution:
go to xampp/mysql/data and take a backup of this folder
delete all selected files in the below image
Copy selected files in below image from xampp/mysql/backup and paste it to xampp/mysql/data folder
Now restart your xampp server and it will run like before. no need to delete your database or reinstall your xampp server

If you're not running XAMPP as an administrator, shutting down MySQL can cause corruption which means you have to repair or delete your tables. This can easily be avoided by running XAMPP as administrator.

Open Services on XAMPP Control Panel
Look for the service MySQL80, right click on this service and click Stop
Get back to XAMPP Control Panel and start MySQL

this worked for me.
Open Services on XAMPP Control Panel
Look for the Services > MySQL80,
right click on this Services and click Stop
Get back to XAMPP Control Panel and start MySQL
thanks to #Shahjahan

Related

XAMPP Control Panel v 3.3.0 - Error: MySQL shutdown unexpectedly

Tried to start my apache server today and MySQL is not running, this is the error that it shows:
10:15:28 AM [mysql] Status change detected: running
10:15:32 AM [mysql] Status change detected: stopped
10:15:32 AM [mysql] Error: MySQL shutdown unexpectedly.
10:15:32 AM [mysql] This may be due to a blocked port, missing dependencies,
10:15:32 AM [mysql] improper privileges, a crash, or a shutdown by another method.
10:15:32 AM [mysql] Press the Logs button to view error logs and check
10:15:32 AM [mysql] the Windows Event Viewer for more clues
10:15:32 AM [mysql] If you need more help, copy and post this
10:15:32 AM [mysql] entire log window on the forums
This is the log error from the xampp control panel:
2021-06-10 10:15:28 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2021-06-10 10:15:28 0 [Note] InnoDB: Uses event mutexes
2021-06-10 10:15:28 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-06-10 10:15:28 0 [Note] InnoDB: Number of pools: 1
2021-06-10 10:15:28 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-06-10 10:15:28 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2021-06-10 10:15:28 0 [Note] InnoDB: Completed initialization of buffer pool
2021-06-10 10:15:29 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-06-10 10:15:29 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-06-10 10:15:29 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-06-10 10:15:29 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2021-06-10 10:15:29 0 [Note] InnoDB: Waiting for purge to start
2021-06-10 10:15:29 0 [Note] InnoDB: 10.4.19 started; log sequence number 47133; transaction id 8
2021-06-10 10:15:29 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2021-06-10 10:15:29 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-06-10 10:15:29 0 [Note] InnoDB: Buffer pool(s) load completed at 210610 10:15:29
2021-06-10 10:15:29 0 [Note] Server socket created on IP: '::'.
Tried to:
Rename the folder mysql/data to mysql/data_old (you can use any name)
Create a new folder mysql/data
Copy the content that resides in mysql/backup to the new mysql/data folder
Copy all your database folders that are in mysql/data_old to mysql/data (skipping the mysql, performance_schema, and phpmyadmin folders from data_old)
Finally copy the ibdata1 file from mysql/data_old and replace it inside mysql/data folder
Start MySQL from XAMPP control panel
Also tried:
exit Xampp server
go to your C:\xampp\mysql\data directory
delete the ibdata1 file
restart xampp server
Who knows the solution?
If anyone will be interested in the answer, just reinstalled the xammp control panel since it was still giving me errors
btw for future reference this can happen when you shut down your computer with xampp still running.

XAMPP on Windows MYSQL Will start and then stop abruptly but APACHE works fine

Alright, I looked everywhere for a solution and none of them worked. Yesterday, My XAMPP worked perfectly fine. Today, I tried to start my MySQL service and it doesn't work. Let me be more specific: This is the XAMPP log:
Attempting to start MySQL app...
9:54:00 AM [mysql] Status change detected: running
9:54:01 AM [mysql] Status change detected: stopped
9:54:01 AM [mysql] Error: MySQL shutdown unexpectedly.
9:54:01 AM [mysql] This may be due to a blocked port, missing dependencies,
9:54:01 AM [mysql] improper privileges, a crash, or a shutdown by another >method.
9:54:01 AM [mysql] Press the Logs button to view error logs and check
9:54:01 AM [mysql] the Windows Event Viewer for more clues
9:54:01 AM [mysql] If you need more help, copy and post this
9:54:01 AM [mysql] entire log window on the forum
This is the error log:
016-03-23 09:54:00 1d04 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.
160323 9:54:00 [Note] InnoDB: Using mutexes to ref count buffer pool pages
160323 9:54:00 [Note] InnoDB: The InnoDB memory heap is disabled
160323 9:54:00 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
160323 9:54:00 [Note] InnoDB: Memory barrier is not used
160323 9:54:00 [Note] InnoDB: Compressed tables use zlib 1.2.3
160323 9:54:00 [Note] InnoDB: Not using CPU crc32 instructions
160323 9:54:00 [Note] InnoDB: Initializing buffer pool, size = 16.0M
160323 9:54:00 [Note] InnoDB: Completed initialization of buffer pool
160323 9:54:00 [Note] InnoDB: Highest supported file format is Barracuda.
160323 9:54:00 [Note] InnoDB: The log sequence numbers 1665234 and 1665234 in ibdata files do not match the log sequence number 2110930 in the ib_logfiles!
160323 9:54:00 [Note] InnoDB: Database was not shutdown normally!
160323 9:54:00 [Note] InnoDB: Starting crash recovery.
160323 9:54:00 [Note] InnoDB: Reading tablespace information from the .ibd files...
160323 9:54:00 [Note] InnoDB: Restoring possible half-written data pages
160323 9:54:00 [Note] InnoDB: from the doublewrite buffer...
160323 9:54:01 [Note] InnoDB: 128 rollback segment(s) are active.
160323 9:54:01 [Note] InnoDB: Waiting for purge to start
160323 9:54:01 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.22-72.0 started; log sequence number 2110930
160323 9:54:01 [Note] Plugin 'FEEDBACK' is disabled.
160323 9:54:01 [Note] Server socket created on IP: '::'.
Apache works and is running btw. The things that I tried:
Deleting the ibdata1 file.
Changing the port in my.ini.
Skype is not running.
Stopping World wide Web Publishing Service.
Ok, I figured it out myself. So I looked into the windows event viewer and saw that some errors were coming from MySQL. I clicked on the most recent one and found this.
mysqld.exe: Table '.\mysql\db' is marked as crashed and last (automatic?) repair failed
I replaced all db files: db.frm, db. MYD, and db.MYI (Copy these to desktop just in case) with the ones from backup. And viola it works again. All the data is there, even the ones I remember inserting in yesterday.
In my case it is because I have MySQL Workbench installed, which also uses port 3306 for its own installation of MySQL.
So there are 2 installations of MySQL, and both trying to use port 3306. Workbench seemed to take precedence.
It was easiest to change XAMPP MySQL to use port 3308.
From XAMPP Control Panel: Stop Apache and MySql.
Edit my.ini (in some MySql installations this will be my.cnf; in others my.ini)
It's location will depend on where you have installed XAMPP. On my system I found it at T:\xampp\mysql\bin\my.ini.
(The comparable file for my MySQL Workbench on my system is located at ``)
Search for 3306 (or port); Replace with 3308.
There were 2 places where I replaced the line: port = 3306 with: port = 3308
Save
From XAMPP Control Panel: Start Apache and MySql

MySQL service doesn't run

I have a problem with MySQL. WAMP is orange with service online, but not MySQL. It displays the following error:
#2002 - No connection could be made because the target machine actively refused it.
This is the log error:
2015-11-18 22:13:24 7408 [Note] Plugin 'FEDERATED' is disabled.
2015-11-18 22:13:24 7408 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-11-18 22:13:24 7408 [Note] InnoDB: The InnoDB memory heap is disabled
2015-11-18 22:13:24 7408 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-11-18 22:13:24 7408 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-11-18 22:13:24 7408 [Note] InnoDB: Not using CPU crc32 instructions
2015-11-18 22:13:24 7408 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-11-18 22:13:24 7408 [Note] InnoDB: Completed initialization of buffer pool
2015-11-18 22:13:24 7408 [Note] InnoDB: Highest supported file format is Barracuda.
2015-11-18 22:13:24 7408 [Note] InnoDB: The log sequence numbers 101407365 and 101407365 in ibdata files do not match the log sequence number 101451472 in the ib_logfiles!
2015-11-18 22:13:24 7408 [Note] InnoDB: Database was not shutdown normally!
2015-11-18 22:13:24 7408 [Note] InnoDB: Starting crash recovery.
2015-11-18 22:13:24 7408 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-11-18 22:13:24 7408 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace catalog_estudio/ost_qacomments uses space ID: 70 at filepath: .\catalog_estudio\ost_qacomments.ibd. Cannot open tablespace osticket/ost_content which uses space ID: 70 at filepath: .\osticket\ost_content.ibd
InnoDB: Error: could not open single-table tablespace file .\osticket\ost_content.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
I tried to find my.cnf but it doesn't exist. I removed the .ibd files but the issue remains the same.
MySQL port on the server is either firewalled, or mysql isn't listening on that port. "actively refusing" means the target machine returned a "connection refused".
Change this file: "C:\wamp\bin\mysql[mysql_version]\my.ini"
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
and MySQL server
[wampmysqld]
port = 3306
socket = /tmp/mysql.sock
You could change port number default 3306 to 3309 like.
UPDATE
mysql.sock is not a simple file which you can just create. MySQL will create on the start by "itself".
Try to start MySQL and then provide us with a full mysqld.log.
I assume that it`s the following and workaround/solution can be found here itself in it:
InnoDB: Error: could not open single-table tablespace file .\mysql\slave_worker_info.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
1) If there is a permission problem in the file and mysqld cannot open the file, you should modify the permissions.
2) If the table is not needed, or you can restore it from a backup, then you can remove the .ibd file, and InnoDB will do a normal crash recovery and ignore that table.
3) If the file system or the disk is broken, and you cannot remove the .ibd file, you can set innodb_force_recovery > 0 in my.cnf and force InnoDB to continue crash recovery here:
1) In [mysqld] section, add the following line:
innodb_force_recovery = 1
2) Save the file and try starting MySQL.
3) when recovery is finished, remove that line which you just added and restart MySQL.

WAMP server orange after inappropriate shut down

My computer has turned off due to power loss while the wamp server is running, now when I am trying to turn the server on it remains orange the http requests to server is working, but when I am trying to log in to MySQl I am getting the following error :
#2002 Cannot log in to the MySQL server
I have done some search and all the results was to remove it and reinstall is there any other way?
I am still a beginner so I don't actually know which files I need to show you in order to help me please comment of anything I need to show.
My last log in attempt in mysql log :
2015-11-11 11:08:03 8052 [Note] Plugin 'FEDERATED' is disabled.
2015-11-11 11:08:03 8052 [Note] InnoDB: The InnoDB memory heap is disabled
2015-11-11 11:08:03 8052 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-11-11 11:08:03 8052 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-11-11 11:08:03 8052 [Note] InnoDB: Not using CPU crc32 instructions
2015-11-11 11:08:03 8052 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-11-11 11:08:03 8052 [Note] InnoDB: Completed initialization of buffer pool
2015-11-11 11:08:03 8052 [Note] InnoDB: Highest supported file format is Barracuda.
2015-11-11 11:08:03 8052 [Note] InnoDB: The log sequence numbers 2671283 and 2671283 in ibdata files do not match the log sequence number 2671293 in the ib_logfiles!
2015-11-11 11:08:03 8052 [Note] InnoDB: Database was not shutdown normally!
2015-11-11 11:08:03 8052 [Note] InnoDB: Starting crash recovery.
2015-11-11 11:08:03 8052 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-11-11 11:08:03 8052 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace coldatabase/item uses space ID: 3 at filepath: .\coldatabase\item.ibd. Cannot open tablespace mysql/slave_relay_log_info which uses space ID: 3 at filepath: .\mysql\slave_relay_log_info.ibd
InnoDB: Error: could not open single-table tablespace file .\mysql\slave_relay_log_info.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
I had similar problems and i solved it by two methods and i am mentioning the better one of the two.
copy c:\wamp folder to any other safe location
let the orginal c:\wamp folder stay in its place
install the wamp server from the same package that you used to install before
start the wamp server
DONE...!!!
(The copy of c:\wamp folder to any other safe location was just for emergency, in case something goes wrong).

XAMPP/MySQL: could not open single-table tablespace file .\mysql\innodb_index_stats.ibd after restart of MySQL

I've installed Drupal on my local XAMPP Server. It worked all fine, no problems with including and working with the database/site till i restarted XAMPP. Since then I get the following at my logfile:
2013-09-02 16:18:46 2544 [Note] Plugin 'FEDERATED' is disabled.
2013-09-02 16:18:46 3e8 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.
2013-09-02 16:18:46 2544 [Note] InnoDB: The InnoDB memory heap is disabled
2013-09-02 16:18:46 2544 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2013-09-02 16:18:46 2544 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-09-02 16:18:46 2544 [Note] InnoDB: Not using CPU crc32 instructions
2013-09-02 16:18:46 2544 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2013-09-02 16:18:46 2544 [Note] InnoDB: Completed initialization of buffer pool
2013-09-02 16:18:46 2544 [Note] InnoDB: Highest supported file format is Barracuda.
2013-09-02 16:18:47 2544 [Note] InnoDB: The log sequence numbers 1600614 and 1600614 in ibdata files do not match the log sequence number 1600644 in the ib_logfiles!
2013-09-02 16:18:47 2544 [Note] InnoDB: Database was not shutdown normally!
2013-09-02 16:18:47 2544 [Note] InnoDB: Starting crash recovery.
2013-09-02 16:18:47 2544 [Note] InnoDB: Reading tablespace information from the .ibd files...
2013-09-02 16:18:47 2544 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace drupal/variable uses space ID: 2 at filepath: .\drupal\variable.ibd. Cannot open tablespace mysql/innodb_index_stats which uses space ID: 2 at filepath: .\mysql\innodb_index_stats.ibd
InnoDB: Error: could not open single-table tablespace file .\mysql\innodb_index_stats.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
I looked for a solution via google but it seems to be a problem just with the drupal database because it's able to connect with MySQL if I remove the database.
I hope someone could help me :(.
Move (DON'T DELETE) those files, into another folder:
innodb_index_stats.frm
innodb_table_stats.frm
slave_master_info.frm
slave_relay_log_info.frm
slave_worker_info.frm
and .ibd files with the same filename:
innodb_index_stats.ibd
innodb_table_stats.ibd
slave_master_info.ibd
slave_relay_log_info.ibd
slave_worker_info.ibd
Try start MySQL.
You can solve this problem by adding a line in your mysql config file: my.cnf or my.ini (depends on your distro)
just under [mysqld] add this line: innodb_force_recovery = 1
..
[mysqld]
innodb_force_recovery = 1
..
Then restart your MySql Server.
You could have lost some data but you'll get the server working again with your data.
Regards,
dev_khan,
try restarting MySQL in Read-Only mode with the innodb_force_recovery option enabled:
Edit my.cnf - find the line: # innodb_force_recovery = 2
Comment the line in (remove the #)
Restart MySQL to let the MySQL engine repair itself.
Comment the innodb_force_recovery line in again (add #)
Restart MySQL again and you have full access again without a Read-Only-Restriction.
Greetings from Germany
This happens with Wordpress too. It only seems to happen with the latest version as I've rolled back to previous versions of AMPPS and it works fine without throwing up this innodb issue.

Categories