XAMPP Control Panel v 3.3.0 - Error: MySQL shutdown unexpectedly - php

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.

Related

How to solve "Error: MySQL shutdown unexpectedly" In Xamp?

When I open XAMPP and click start MySQL button and it gives me an error. I had started it just before, but now it isn't working.
It given error below in xammp
Error: MySQL shutdown unexpectedly.
This may be due to a blocked port, missing dependencies,
improper privileges, a crash, or a shutdown by another method.
Press the Logs button to view error logs and check
the Windows Event Viewer for more clues
If you need more help, copy and post this
entire log window on the forums
Here is the contents of the error log:
2022-03-05 11:17:33 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2022-03-05 11:17:33 0 [Note] InnoDB: Uses event mutexes
2022-03-05 11:17:33 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-03-05 11:17:33 0 [Note] InnoDB: Number of pools: 1
2022-03-05 11:17:33 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-03-05 11:17:33 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2022-03-05 11:17:33 0 [Note] InnoDB: Completed initialization of buffer pool
2022-03-05 11:17:36 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2022-03-05 11:17:36 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-03-05 11:17:36 0 [Note] InnoDB: Setting file 'D:\xamp_7.2\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-03-05 11:17:36 0 [Note] InnoDB: File 'D:\xamp_7.2\mysql\data\ibtmp1' size is now 12 MB.
2022-03-05 11:17:36 0 [Note] InnoDB: Waiting for purge to start
2022-03-05 11:17:36 0 [Note] InnoDB: 10.4.13 started; log sequence number 5683247830; transaction id 653050
2022-03-05 11:17:36 0 [Note] InnoDB: Loading buffer pool(s) from D:\xamp_7.2\mysql\data\ib_buffer_pool
2022-03-05 11:17:36 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-03-05 11:17:36 0 [Note] InnoDB: Buffer pool(s) load completed at 220305 11:17:36
2022-03-05 11:17:36 0 [Note] Server socket created on IP: '::'.
What is the cause of these errors and how can I rectify them?
For my, open and empty the file multi-master.info which is at the base of folder data is enough for me.
There are several causes to this problem, and here are some solutions:
Change Your MySQL Port
One of the main causes of this error “MySQL shutdown unexpectedly” is another software using the port assigned to MySQL which is 3306. To verify this you can use netstat module from XAMPP’s control panel, right above the Shell tool. You can fix this problem and prevent it from repeating in the future by simply changing mysql port. To change it, do the following:
Click Confing found at the top right corner
Click Services and Port Settings
Select MySQL then change 3306 to 3307 then click save
On the main xammp screen, Click on mysql's config then select my.ini then search and replace 3306 with the new port number used, in our case 3307 then save
Restart xampp then the problem is solved! But if your problem is not solved, proceed to solution number 2 below
Restore Your Database Backup
Onother reason for this error is corrupted database, to fix it simply restore your database backup which is created automatically by xampp. By default, your XAMPP MySQL backup files should be under Local Disk > XAMPP > MySQL. Inside that directory, you’ll see several folders, two of which are called data and backup. he data folder includes all of the files that your database uses. The backup folder contains a single recent copy of your MySQL. To restore the MySQL backup, change the name of the data folder to anything else, such as data-old. Then rename the backup folder to data. That’s it!
Fix this error with just 2 steps:
Task Manager
Find MySQL -> end task
Go back to XAMPP -> star MySQL, port 3306 should work again.
If you do this it is possible that some DB that you are also using in that port will be deleted, make sure you have a copy before proceeding.
Open data folder and delete all ib_logfile* (ib_logfile0, ib_logfile1).
Then restart xamp, so it solved for me.
Reference:
https://community.apachefriends.org/f/viewtopic.php?t=82071&p=276632

XAMPP - MySQL Shut down Unexpectedly at start in XAMPP control

When I open XAMPP control application and click start MySQL button it won't start and it gives me an error. It starts and after a couple of seconds it shutdowns automatically. the errors from the XAMPP control application is mentioned in below.
12:03:32 PM [mysql] Attempting to start MySQL app...
12:03:32 PM [mysql] Status change detected: running
12:03:34 PM [mysql] Status change detected: stopped
12:03:34 PM [mysql] Error: MySQL shutdown unexpectedly.
12:03:34 PM [mysql] This may be due to a blocked port, missing
dependencies,
12:03:34 PM [mysql] improper privileges, a crash, or a shutdown by
another method.
12:03:34 PM [mysql] Press the Logs button to view error logs and
check
12:03:34 PM [mysql] the Windows Event Viewer for more clues
12:03:34 PM [mysql] If you need more help, copy and post this
12:03:34 PM [mysql] entire log window on the forums
The Following are the errors from my error log
2021-12-21 12:03:32 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2021-12-21 12:03:32 0 [Note] InnoDB: Uses event mutexes
2021-12-21 12:03:32 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-12-21 12:03:32 0 [Note] InnoDB: Number of pools: 1
2021-12-21 12:03:32 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-12-21 12:03:32 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2021-12-21 12:03:32 0 [Note] InnoDB: Completed initialization of buffer pool
2021-12-21 12:03:32 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=300288
2021-12-21 12:03:32 0 [Warning] InnoDB: Are you sure you are using the right ib_logfiles to start up the database? Log sequence number in the ib_logfiles is 300288, less than the log sequence number in the first system tablespace file header, 300360.
2021-12-21 12:03:32 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-12-21 12:03:32 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-12-21 12:03:32 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-12-21 12:03:32 0 [Note] InnoDB: Setting file 'D:\XAMMP\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-12-21 12:03:32 0 [Note] InnoDB: File 'D:\XAMMP\mysql\data\ibtmp1' size is now 12 MB.
2021-12-21 12:03:32 0 [Note] InnoDB: Waiting for purge to start
2021-12-21 12:03:32 0 [Note] InnoDB: 10.4.22 started; log sequence number 300297; transaction id 170
2021-12-21 12:03:32 0 [Note] InnoDB: Loading buffer pool(s) from D:\XAMMP\mysql\data\ib_buffer_pool
2021-12-21 12:03:32 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-12-21 12:03:32 0 [Note] Server socket created on IP: '::'.
2021-12-21 12:03:32 0 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 10048: Only one usage of each socket address (protocol/network address/port) is normally permitted.
2021-12-21 12:03:32 0 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2021-12-21 12:03:32 0 [ERROR] Aborting
what may cause the problem and how can I resolve them? Thank you in advance
I Got it worked. Didn't change the port and kept it default as 3306. Did the following.
renamed the XAMMP\mysql\data folder to any other name you wish (say data_old )
make a new folder in XAMMP\mysql name data and copy all the files in it including ibdata1
close all running programs and restart XAMPP
No need to copy files from data_old but if you do have previously constructed databases then you may copy some files from data_old.
Special Thanks for everyone who supported.
The easiest way is change port to 3307 or other than 3306 from my.ini and edit "\xamppphp\MyAdmin\config.inc.php"add extra line under
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Servers'][$i]['port'] = 3308;
if u need explaination I've made Youtube video sE2UkEcth0w
https://www.youtube.com/watch?v=sE2UkEcth0w
seems like following error from the message
Either port is blocked
Or Application doesn't have enough permission to access those port and serve web application.
To fix this
Right click on XAMPP and Click on Run as Administrator
This will prompt you for password or confirmation.
Allow by providing password or permission
This will run XAMPP in highest privilege, so you won't be facing permission issue anymore.
If this works, you can do few more step to avoid running as administrator manually every time.
Right click on XAMPP icon
Go to properties
Look for option > Run as administrator
[*] check the option and save
This will ask for confirmation/password every time when you run XAMPP.
Hope this solves your issue.

MySql Crashed When Starting Xampp?

When I started the MYSQL from Xampp it crashed. It gave me this error:
8:32:33 AM [mysql] Attempting to start MySQL app...
8:32:33 AM [mysql] Status change detected: running
8:32:37 AM [mysql] Status change detected: stopped
8:32:37 AM [mysql] Error: MySQL shutdown unexpectedly.
8:32:37 AM [mysql] This may be due to a blocked port, missing dependencies, 8:32:37 AM [mysql] improper privileges, a crash, or a shutdown by another method. 8:32:37 AM [mysql] Press the Logs button to view error logs and check
8:32:37 AM [mysql] the Windows Event Viewer for more clues 8:32:37 AM [mysql] If you need more help, copy and post this
8:32:37 AM [mysql] entire log window on the forums
error log InnoDB: using atomic writes.
2020-05-13 8:26:07 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2020-05-13 8:26:07 0 [Note] InnoDB: Uses event mutexes
2020-05-13 8:26:07 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-05-13 8:26:07 0 [Note] InnoDB: Number of pools: 1
2020-05-13 8:26:07 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-05-13 8:26:07 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2020-05-13 8:26:07 0 [Note] InnoDB: Completed initialization of buffer pool
2020-05-13 8:26:07 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-05-13 8:26:07 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-05-13 8:26:07 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-05-13 8:26:07 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2020-05-13 8:26:07 0 [Note] InnoDB: Waiting for purge to start
2020-05-13 8:26:07 0 [Note] InnoDB: 10.4.11 started; log sequence number 73242724; transaction id 45388
2020-05-13 8:26:07 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2020-05-13 8:26:07 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-05-13 8:26:07 0 [Note] Server socket created on IP: '::'.
Can someone please help me and tell what actually is happening
Probably your port is busy. If you use Linux you can try to run "lsof -i" to detect what is using your port.
Well I also used to get this kind of problem. I resolved this error like this:
1) Open the Xampp control panel and click Services
2)Find the MYSQL08 option. It might show the service is started.
3)Stop the service and try starting the mysql again
Hope so it might help you.

Xampp mysql Error: MySQL shutdown unexpectedly

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

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

Categories