> For the complete documentation index, see [llms.txt](https://learnimportant.gitbook.io/learn-important/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learnimportant.gitbook.io/learn-important/windows10/cach-chua-khong-khoi-dong-duoc-mysql-tot-nhat-tung-lam-3306-ok.md).

# Cách chữa không khởi động được mysql tốt nhất từng làm 3306 (ok)

https\://stackoverflow\.com/questions/18022809/xampp-mysql-shutdown-unexpectedly

Cach moi: <https://stackoverflow.com/questions/18022809/how-to-solve-error-mysql-shutdown-unexpectedly>

Copy 3 thu muc trong bakup

```

IMPORTANT: do NOT delete ibdata1 file. You could destroy all your databases.

Instead, first try using the MySQL backup folder which is included with XAMPP. So do next steps:

Rename folder mysql/data to mysql/data_old
Make a copy of mysql/backup folder and name it as mysql/data
Copy all your database folders from mysql/data_old into mysql/data (except mysql, performance_schema, and phpmyadmin folders)
Copy mysql/data_old/ibdata1 file into mysql/data folder
Start MySQL from XAMPP control panel
```

Copy 3 thu muc trong C:\xampp\mysql\backup

**Buoc 1**: mysql, performance\_schema, phpmyadmin

![](https://55355946-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lk4gdXN1F2DaoesJ9Bz%2Fuploads%2FDRmtaXkKCWcIh1tfRRnT%2FScreenshot_1.png?alt=media\&token=e009ba02-e3bf-46f6-8937-58cf04c98f58)

**Buoc 2**: copy du lieu web cu loi vao day

![](https://55355946-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lk4gdXN1F2DaoesJ9Bz%2Fuploads%2Fhw0WcjKDoIGagKHiFRNH%2FScreenshot_2.png?alt=media\&token=a30c71c5-e698-415e-b157-dc9c2b3655c4)

```
Step 1 : Close Xampp controller completely
Step 2 : Open C:\xampp\mysql\backup
Step 3 : Copy all the files from backup folder
Step 4 : Open C:\xampp\mysql\data
Step 5 : Paste the all the files in data folder
Step 6 : Re-start the Xampp controller
```

Đọc thêm

Asked 7 years, 9 months agoActive [4 days ago](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly?lastactivity)Viewed 858k times183106

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.

> 12:19:12 PM \[mysql] Attempting to start MySQL app...\
> 12:19:12 PM \[mysql] Status change detected: running\
> 12:19:13 PM \[mysql] Status change detected: stopped\
> 12:19:13 PM \[mysql] Error: MySQL shutdown unexpectedly.\
> 12:19:13 PM \[mysql] This may be due to a blocked port, missing dependencies,\
> 12:19:13 PM \[mysql] improper privileges, a crash, or a shutdown by another method\
> 12:19:13 PM \[mysql] Press the Logs button to view error logs and check\
> 12:19:13 PM \[mysql] the Windows Event Viewer for more clues\
> 12:19:13 PM \[mysql] If you need more help, copy and post this\
> 12:19:13 PM \[mysql] entire log window on the forums

Here is the contents of the error log:

> 2013-08-02 12:19:12 4536 \[Note] Plugin 'FEDERATED' is disabled.\
> 2013-08-02 12:19:12 f64 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-08-02 12:19:12 4536 \[Note] InnoDB: The InnoDB memory heap is disabled\
> 2013-08-02 12:19:12 4536 \[Note] InnoDB: Mutexes and rw\_locks use Windows interlocked functions\
> 2013-08-02 12:19:12 4536 \[Note] InnoDB: Compressed tables use zlib 1.2.3\
> 2013-08-02 12:19:12 4536 \[Note] InnoDB: Not using CPU crc32 instructions\
> 2013-08-02 12:19:12 4536 \[Note] InnoDB: Initializing buffer pool, size = 16.0M\
> 2013-08-02 12:19:12 4536 \[Note] InnoDB: Completed initialization of buffer pool\
> 2013-08-02 12:19:12 4536 \[Note] InnoDB: Highest supported file format is Barracuda.\
> 2013-08-02 12:19:12 4536 \[Note] InnoDB: The log sequence numbers 0 and 0 in ibdata files do not match the log sequence number 1616798 in the ib\_logfiles!\
> 2013-08-02 12:19:12 4536 \[Note] InnoDB: Database was not shutdown normally!\
> 2013-08-02 12:19:12 4536 \[Note] InnoDB: Starting crash recovery.\
> 2013-08-02 12:19:12 4536 \[Note] InnoDB: Reading tablespace information from the .ibd files...

The most important error message is here:

> **2013-08-02 12:19:12 4536 \[ERROR] InnoDB:**\
> Attempted to open a previously opened tablespace.\
> Previous tablespace *mysql/innodb\_table\_stats* uses space ID: 1 at filepath: *.\mysql\innodb\_table\_stats.ibd*.\
> Cannot open tablespace *xat/payments* which uses space ID: 1 at filepath: *.\xat\payments.ibd*

The rest of the log:

> InnoDB: Error: could not open single-table tablespace file .\xat\payments.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.

What is the cause of these errors and how can I rectify them?[mysql](https://stackoverflow.com/questions/tagged/mysql)[xampp](https://stackoverflow.com/questions/tagged/xampp)[Share](https://stackoverflow.com/q/18022809)[Improve this question](https://stackoverflow.com/posts/18022809/edit)Follow[edited Aug 10 '17 at 3:17](https://stackoverflow.com/posts/18022809/revisions)asked Aug 2 '13 at 17:27[![](https://www.gravatar.com/avatar/58ca6d1f60a764875dfce413a7e8dc91?s=32\&d=identicon\&r=PG)](https://stackoverflow.com/users/2646822/austin)[Austin](https://stackoverflow.com/users/2646822/austin)1,84333 gold badges1010 silver badges1111 bronze badges[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)

### 48 Answers

[Active](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly?answertab=active#tab-top)[Oldest](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly?answertab=oldest#tab-top)[Votes](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly?answertab=votes#tab-top)1[2](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly?page=2\&tab=votes#tab-top)[Next](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly?page=2\&tab=votes#tab-top)582

> **STOP!** Please do NOT delete `ibdata1` file!

Deleting this file is like playing a Russian roulette with your databases, it could work and restablish everything, but also, probably could leave unusable every database you have.

Instead, first try using the **MySQL backup folder** which is included with XAMPP. So do the next:

1. Rename the folder `mysql/data` to `mysql/data_old` (you can use any name)
2. Create a new folder `mysql/data`
3. Copy the content that resides in `mysql/backup` to the new `mysql/data` folder
4. 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`)
5. Finally copy the `ibdata1` file from `mysql/data_old` and replace it inside `mysql/data` folder
6. Start MySQL from XAMPP control panel

And, voilà\![Share](https://stackoverflow.com/a/61859561)[Improve this answer](https://stackoverflow.com/posts/61859561/edit)Follow[edited Jan 24 at 16:30](https://stackoverflow.com/posts/61859561/revisions)answered May 17 '20 at 22:20[![](https://i.stack.imgur.com/XCDBj.jpg?s=32\&g=1)](https://stackoverflow.com/users/5373542/fabrizio-valencia)[Fabrizio Valencia](https://stackoverflow.com/users/5373542/fabrizio-valencia)6,22522 gold badges1111 silver badges1818 bronze badges

* 44This is the best answer, doesn't ask you to delete any files or folder and importantly, it works. – [gegobyte](https://stackoverflow.com/users/4152581/gegobyte) [Jun 30 '20 at 6:46](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment110794820_61859561)
* 29This is the best answer – [Kevin E. Ogbonna](https://stackoverflow.com/users/6794204/kevin-e-ogbonna) [Jul 5 '20 at 9:51](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment110947643_61859561)
* 11I've resorted to this answer sooo many times that I even wrote a PowerShell script to automate the process: [gist.github.com/josemmo/24e35f2b4984a4370ce2c164f5956437](https://gist.github.com/josemmo/24e35f2b4984a4370ce2c164f5956437) – [josemmo](https://stackoverflow.com/users/1956278/josemmo) [Aug 28 '20 at 18:50](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment112535314_61859561)&#x20;
* 9this should be the top answer – [zero8](https://stackoverflow.com/users/3572219/zero8) [Sep 1 '20 at 5:52](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment112610559_61859561)
* 5Yes, this is best answer. my bad I have not tried it first. Excellent answer. You saved my db data and lots of hassles. Hats off to you man! – [Nilesh](https://stackoverflow.com/users/459505/nilesh) [Sep 10 '20 at 16:20](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment112879051_61859561)

[Show **42** more comments](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)180

> **IMPORTANT** Deleting this file may render any existing MySQL data unusable. Use with caution

Hey I just did this and it worked:

1. *exit* Xampp server
2. go to your `C:\xampp\mysql\data` directory
3. *delete* the `ibdata1` file
4. *restart* xampp server

It should work[Share](https://stackoverflow.com/a/18162264)[Improve this answer](https://stackoverflow.com/posts/18162264/edit)Follow[edited Nov 6 '20 at 20:28](https://stackoverflow.com/posts/18162264/revisions)[![](https://i.stack.imgur.com/Y0oJ0.jpg?s=32\&g=1)](https://stackoverflow.com/users/2370483/machavity)[Machavity](https://stackoverflow.com/users/2370483/machavity)♦28.6k2525 gold badges7575 silver badges9191 bronze badgesanswered Aug 10 '13 at 13:14[![](https://www.gravatar.com/avatar/e6874596da044d3f4f14c6522dc9f7fe?s=32\&d=identicon\&r=PG)](https://stackoverflow.com/users/2670487/kratos)[Kratos](https://stackoverflow.com/users/2670487/kratos)2,16911 gold badge99 silver badges22 bronze badges

* 32This works and should likely be marked as the correct answer. However rename the file to ibdata1.bak rather than delete it. Just to be save. – [Lorenz Lo Sauer](https://stackoverflow.com/users/901946/lorenz-lo-sauer) [Sep 3 '13 at 12:13](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment27360525_18162264)&#x20;
* 23This will, of course, destroy all the data which was stored in that file (all the InnoDB tables which were created before setting `innodb_file_per_table` to enabled). The methods suggested in the log message seem suprtior to me. – [Tgr](https://stackoverflow.com/users/323407/tgr) [Oct 12 '13 at 10:50](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment28639840_18162264)
* 17I also had to delete `ib_logfile0` and `ib_logfile1` to get it to work – [Allan Macmillan](https://stackoverflow.com/users/2623052/allan-macmillan) [Jun 19 '14 at 18:58](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment37579575_18162264)
* 13Ouch! Blowing away `ibdata1` is equivalent to losing all your data (or at least all that are `ENGINE=Innodb` ! – [Rick James](https://stackoverflow.com/users/1766831/rick-james) [Mar 14 '17 at 4:16](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment72670006_18162264)
* 19The most upvoted unexplained reckless thing you can do – [user10089632](https://stackoverflow.com/users/7386695/user10089632) [Jan 14 '18 at 10:36](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment83479874_18162264)

[Show **7** more comments](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)43

1. Go to **mysql/data/**
2. Delete all random files (except the actual database folders)
3. Restart **Apache** and **MySQL**.

It should fix it.[Share](https://stackoverflow.com/a/34924443)[Improve this answer](https://stackoverflow.com/posts/34924443/edit)Follow[edited Jan 21 '16 at 13:06](https://stackoverflow.com/posts/34924443/revisions)answered Jan 21 '16 at 12:55[![](https://i.stack.imgur.com/zVp9Z.jpg?s=32\&g=1)](https://stackoverflow.com/users/3845649/kerim)[Kerim](https://stackoverflow.com/users/3845649/kerim)1,0071212 silver badges1111 bronze badges

* 11It deleted all my data. There was a lot of data. – [Paras](https://stackoverflow.com/users/3557386/paras) [Mar 17 '17 at 11:08](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment72817912_34924443)
* 12I confirm that deleting files will make all DB unusable. Table files are there but they can't display. – [Adrian P.](https://stackoverflow.com/users/1058605/adrian-p) [Apr 25 '18 at 0:27](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment87041146_34924443)&#x20;

[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)32

If the answers mentioned above are not working, you can try deleting all the files in data, except for the folder

Goto: C:\xampp\mysql\data

[![enter image description here](https://i.stack.imgur.com/uyvBO.png)](https://i.stack.imgur.com/uyvBO.png)

After that: Goto: C:\xampp\mysql\bin

then open with notepad **my.ini** , Its look like this.

[![enter image description here](https://i.stack.imgur.com/pZzmW.png)](https://i.stack.imgur.com/pZzmW.png)

Then delete or put into comment the port 3306 and change it to 8111 then run xamp with administrator and its work well.[Share](https://stackoverflow.com/a/59941472)[Improve this answer](https://stackoverflow.com/posts/59941472/edit)Follow[edited Nov 8 '20 at 16:22](https://stackoverflow.com/posts/59941472/revisions)[![](https://www.gravatar.com/avatar/97c50ba9724932f78c6167543d06d3d3?s=32\&d=identicon\&r=PG\&f=1)](https://stackoverflow.com/users/4895687/cloudbalancing)[CloudBalancing](https://stackoverflow.com/users/4895687/cloudbalancing)32011 gold badge22 silver badges1414 bronze badgesanswered Jan 28 '20 at 2:36[![](https://i.stack.imgur.com/AT7On.jpg?s=32\&g=1)](https://stackoverflow.com/users/7951311/mathew-magante)[Mathew Magante](https://stackoverflow.com/users/7951311/mathew-magante)71211 gold badge1111 silver badges2727 bronze badges

* Love You @Matthew Magante. You have solved my problem which I was facing for last one year. Thanks a lot. – [Kashif Iftikhar](https://stackoverflow.com/users/12598819/kashif-iftikhar) [Mar 24 '20 at 6:20](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment107616870_59941472)
* 1Now, I am not getting that error in xampp but still phpmyadmin is not workin g – [Sarvesh Tiwari](https://stackoverflow.com/users/7079569/sarvesh-tiwari) [Apr 16 '20 at 10:45](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment108352384_59941472)
* Thanks, @fabrizio valencia fix was doing well but after two or three times it was not working anymore and this solved as second fix. – [Fer Toasted](https://stackoverflow.com/users/13772033/fer-toasted) [Nov 14 '20 at 16:18](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment114631817_59941472)

[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)17

When you're **not** running XAMPP as an administrator, shutting down MySQL frequently causes corruption which means you have to repair or delete your tables. To avoid this you need to either run XAMPP as an administrator, or use the proper command prompt method for shutting down MySQL.

You can delete `ibdata1` as Kratos suggests, but this can leave you with a broken database as other pieces of your database are still in the `/mysql/data/` folder. In my case, this residual data stopped me successfully installing WordPress.

A cleaner way of undoing the damage is to revert your whole `/mysql/data/` folder. Windows has built-in folder versioning — right click on `/mysql/data/` and select `Restore previous versions`. You can then delete the current contents of the folder and replace it with the older version's contents.

Addendum: To ensure that you don't forget to run XAMPP as an administrator you can right click the XAMPP shortcut, go to `Properties`, then `Advanced`, and finally tick `Run as administrator`.[Share](https://stackoverflow.com/a/19840013)[Improve this answer](https://stackoverflow.com/posts/19840013/edit)Followanswered Nov 7 '13 at 15:37[![](https://i.stack.imgur.com/uLyc8.jpg?s=32\&g=1)](https://stackoverflow.com/users/2820212/ryan-williams)[Ryan Williams](https://stackoverflow.com/users/2820212/ryan-williams)60755 silver badges1111 bronze badges

* 1This should be accepted as correct answer. If you remove ibdata1, there will be tons of orphaned tables. – [sean](https://stackoverflow.com/users/3557445/sean) [Mar 3 '15 at 20:05](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment45951033_19840013)
* Thanks, you fixed my problem after trying a ton of different things. – [user3089840](https://stackoverflow.com/users/3089840/user3089840) [Dec 23 '15 at 21:42](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment56630059_19840013)
* also fixed issue for me – [Gaz Smith](https://stackoverflow.com/users/4400544/gaz-smith) [Apr 29 '19 at 8:36](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment98455429_19840013)
* Nice explannation :D Thank you. – [logbasex](https://stackoverflow.com/users/10393067/logbasex) [Jun 4 '20 at 3:21](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment109982606_19840013)
* The 'Restore previous versions' option only works if you regularly create Restore Points in Windows. :( – [nockieboy](https://stackoverflow.com/users/6033674/nockieboy) [Jun 9 '20 at 9:04](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment110144941_19840013)

[Show **2** more comments](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)15

**My Xampp MySQL worked just follows as below:**

```
01.Go to mysql/data/ directory
02. delete the ibdata1 & ib_logfile*(ib_logfile0,ib_logfile1,ib_logfile101) file
03. restart xampp server
```

[Share](https://stackoverflow.com/a/40957320)[Improve this answer](https://stackoverflow.com/posts/40957320/edit)Followanswered Dec 4 '16 at 9:45[![](https://i.stack.imgur.com/d1VxS.jpg?s=32\&g=1)](https://stackoverflow.com/users/2239022/matinict)[matinict](https://stackoverflow.com/users/2239022/matinict)2,08422 gold badges2424 silver badges3434 bronze badges

* this is the most effective way for me !! – [Youssef Boudaya](https://stackoverflow.com/users/10564042/youssef-boudaya) [Jun 4 '20 at 14:17](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment110001224_40957320)

[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)14

Add the following line below the `[mysqld]` section in the mysql config file (my.ini) and restart the apache web server and the mysql service afterwards.

```
[mysqld]
innodb_force_recovery = 4
```

[Share](https://stackoverflow.com/a/20617180)[Improve this answer](https://stackoverflow.com/posts/20617180/edit)Follow[edited May 5 '14 at 8:15](https://stackoverflow.com/posts/20617180/revisions)[![](https://i.stack.imgur.com/J56Tk.jpg?s=32\&g=1)](https://stackoverflow.com/users/1360984/harmlezz)[Harmlezz](https://stackoverflow.com/users/1360984/harmlezz)7,5042323 silver badges3434 bronze badgesanswered Dec 16 '13 at 17:40[![](https://www.gravatar.com/avatar/3b2b7e61f57b77cab54880551f316c7b?s=32\&d=identicon\&r=PG\&f=1)](https://stackoverflow.com/users/1826703/aog)[aog](https://stackoverflow.com/users/1826703/aog)44433 silver badges1414 bronze badges

* 7Read about what you are doing, before you do it: [dev.mysql.com/doc/refman/5.0/en/forcing-innodb-recovery.html](http://dev.mysql.com/doc/refman/5.0/en/forcing-innodb-recovery.html) – [marcovtwout](https://stackoverflow.com/users/729324/marcovtwout) [Sep 30 '14 at 11:56](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment40936587_20617180)
* Thank you so much, really helped me a lot. – [Lohn Claidon](https://stackoverflow.com/users/2373441/lohn-claidon) [Oct 28 '14 at 5:10](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment41816323_20617180)
* 5it's better to start with value 1 and increment it each time it didn't work. Values 1-3 are considered save. 4-6 can corrupt data! – [CoR](https://stackoverflow.com/users/352260/cor) [Aug 18 '15 at 20:26](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment52060030_20617180)
* This helped me. As pointed out, use values 1-3 first. 2 worked on me. I had to dump all my database, reset mysql data using the back up folder then import the dumps. This is helpful if you want to keep your data – [claw68](https://stackoverflow.com/users/1160005/claw68) [Sep 13 '20 at 5:42](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment112938816_20617180)

[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)13

I got the same kind of error in my `C:\xampp\mysql\data\mysql_error.log` when trying to start mysql.

```
2013-08-05 01:20:32 6780 [ERROR] InnoDB: Attempted to open a previously 
  opened tablespace. Previous tablespace mysql/slave_relay_log_info uses 
  space ID: 3 at filepath: .\mysql\slave_relay_log_info.ibd. Cannot open  
  tablespace test_database/test_table which uses space ID: 3 at filepath:  
  .\test_database\test_table.ibd
```

You'll have to read the error closely. This says that `test_database` is preventing mysql from starting.

**You could blow away the offending database, these steps fix the problem:**

1. Make sure mysql and xampp is shut down completely.
2. Go to your directory where mysql is installed, mine is: `C:\xampp\mysql\data`
3. You should see a folder with the name of a database that you created. mine was `test_database`.
4. Create a new folder somewhere else called `C:\xampp\mysql\data\mysql\backuptablespace`
5. Drag and drop (don't delete) the offending database table folder to the backup directory.
6. Try to start mysql again. For me it started right up in 1 second as expected.

If it doesn't work, put the file back where you started and you'll be back where you started.

**If you don't want to delete the database and don't have backups:**

If you don't have backups of table data and mysql won't start because something is corrupted you'll have to use the process of elimination to guess-and-check your way to exactly what you did that corrupted it. Follow these steps:

1. Make a clone of the entire `C:\xampp\` and store it somewhere safe so you can get back to where you started.
2. Use a "binary search" approach to try to locate the corrupted item in the mysql database. It could be a file, or a table, or a database, or a user or anything.
3. Delete the entire database and see if that allows mysql to start. If it does, then put back the database and try removing some of the tables. If it doesn't, then try yanking out something else until it does start.
4. Try removing these files from `C:\xampp\mysql\data\mysql`: db.frm db.MRD db.MYI db.opt user.frm user.MYD user.MYI
5. When you get mysql to start, try putting things back until you find the one thing that you add which prevents it from starting. One bonus for this is you learn how mysql works under the hood.

**Nuclear option:**

Something you did screwed up the mysql server. An uninstall and reinstall of XAMPP should undo the corruption.[Share](https://stackoverflow.com/a/18132237)[Improve this answer](https://stackoverflow.com/posts/18132237/edit)Follow[edited Nov 8 '13 at 0:48](https://stackoverflow.com/posts/18132237/revisions)answered Aug 8 '13 at 17:25[![](https://i.stack.imgur.com/2b4pE.jpg?s=32\&g=1)](https://stackoverflow.com/users/445131/eric-leschinski)[Eric Leschinski](https://stackoverflow.com/users/445131/eric-leschinski)123k8181 gold badges381381 silver badges321321 bronze badges[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)7

I also faced this issue and this is how I solved.\
1\. Make sure xampp is not under sub-directory. For example, it should be C:\xampp\
2\. You might need to run as administrator in running the application.

Hope this will work\![Share](https://stackoverflow.com/a/18216554)[Improve this answer](https://stackoverflow.com/posts/18216554/edit)Followanswered Aug 13 '13 at 18:31[![](https://www.gravatar.com/avatar/8e634b1909b56527f21dff0286347f5b?s=32\&d=identicon\&r=PG)](https://stackoverflow.com/users/1005590/sithu)[SITHU](https://stackoverflow.com/users/1005590/sithu)13366 bronze badges[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)6

in my case i did following steps and it worked:

1. In Xampp control panel click on "Services" button from the right side toolbar
2. Then find "MySQL" from the services List
3. Click on it and from the left side of the panel click on "stop"
4. Turn back in Xampp control panel and click on start.

[Share](https://stackoverflow.com/a/59153301)[Improve this answer](https://stackoverflow.com/posts/59153301/edit)Follow[edited Dec 3 '19 at 10:40](https://stackoverflow.com/posts/59153301/revisions)[![](https://www.gravatar.com/avatar/541566093e9d34a3858f5446d06a7a6e?s=32\&d=identicon\&r=PG)](https://stackoverflow.com/users/10632369/tomerpacific)[tomerpacific](https://stackoverflow.com/users/10632369/tomerpacific)3,03977 gold badges2121 silver badges4141 bronze badgesanswered Dec 3 '19 at 8:54[![](https://i.stack.imgur.com/LcUkx.jpg?s=32\&g=1)](https://stackoverflow.com/users/7189597/sobhan)[Sobhan](https://stackoverflow.com/users/7189597/sobhan)57155 silver badges1919 bronze badges

* 1Thank you, none of the other options worked for me, this one did. Very grateful – [user3808307](https://stackoverflow.com/users/3808307/user3808307) [Jan 27 '20 at 19:58](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment105997582_59153301)&#x20;
* @user3808307 I'm glad it helped you :) – [Sobhan](https://stackoverflow.com/users/7189597/sobhan) [Jan 28 '20 at 6:28](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment106006757_59153301)
* thank you so much! this was really simple to do and it worked :) – [Aditi](https://stackoverflow.com/users/10156536/aditi) [Feb 25 at 6:35](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment117324726_59153301)

[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)6

1. move `xampp/mysql/backup` files into `xampp/mysql/data`
2. RUN `XAMPP` as `Administrator`(make sure mysql is installed you can see a green tick if is installed) [![List item](https://i.stack.imgur.com/7IGZO.png)](https://i.stack.imgur.com/7IGZO.png)

Hope it helps\![Share](https://stackoverflow.com/a/61843915)[Improve this answer](https://stackoverflow.com/posts/61843915/edit)Followanswered May 16 '20 at 21:36[![](https://www.gravatar.com/avatar/fecd29708c017daed8874315080b0a38?s=32\&d=identicon\&r=PG)](https://stackoverflow.com/users/3801676/jayant-rajwani)[Jayant Rajwani](https://stackoverflow.com/users/3801676/jayant-rajwani)49855 silver badges1414 bronze badges[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)6

Step 1 : Close Xampp controller completely\
Step 2 : Open C:\xampp\mysql\backup\
Step 3 : Copy all the files from backup folder\
Step 4 : Open C:\xampp\mysql\data\
Step 5 : Paste the all the files in data folder\
Step 6 : Re-start the Xampp controller[Share](https://stackoverflow.com/a/65236659)[Improve this answer](https://stackoverflow.com/posts/65236659/edit)Follow[edited Dec 10 '20 at 17:14](https://stackoverflow.com/posts/65236659/revisions)[![](https://i.stack.imgur.com/rQQMq.png?s=32\&g=1)](https://stackoverflow.com/users/1974224/cristik)[Cristik](https://stackoverflow.com/users/1974224/cristik)24.7k1818 gold badges7070 silver badges9797 bronze badgesanswered Dec 10 '20 at 14:41[![](https://www.gravatar.com/avatar/a1e7c91b1bb841a02ec8046a9f9a5f06?s=32\&d=identicon\&r=PG\&f=1)](https://stackoverflow.com/users/7161449/swap)[Swap](https://stackoverflow.com/users/7161449/swap)8511 silver badge99 bronze badges

* Thanks man worked like a charm for me. :) – [Utpal - Ur Best Pal](https://stackoverflow.com/users/2661868/utpal-ur-best-pal) [Dec 16 '20 at 6:46](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment115476331_65236659)
* Best Solution You saved my time thanks – [Siraj Ali](https://stackoverflow.com/users/11831973/siraj-ali) [Mar 1 at 9:51](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment117422355_65236659)

[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)5

Never delete this file (`ibdata1`) because all your data will be deleted!!!\
I suggest three ways :

**A:**\
1- Exit from `XAMPP control panel`.\
1- Rename the folder `mysql/data` to `mysql/data_old` (you can use any name)\
2- Create a new folder `mysql/data`\
3- Copy the content that resides in `mysql/backup` to the new `mysql/data` folder\
4- 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)\
5- Finally copy the `ibdata1` file from `mysql/data_old` and replace it inside `mysql/data folder`\
6- Reastart your system.<br>

**B**:\
1- Stop all sql services.\
2- Next, start all sql services again.\
\
[![enter image description here](https://i.stack.imgur.com/TUbeH.png)](https://i.stack.imgur.com/TUbeH.png)<br>

**C**:\
1- Open XAMPP control panel\
2- Click on Config button, in front of mysql, click on my.ini\
\
[![enter image description here](https://i.stack.imgur.com/moQuz.png)](https://i.stack.imgur.com/moQuz.png)\
\
3- change client port and server port.\
\
[![enter image description here](https://i.stack.imgur.com/hi5cD.png)](https://i.stack.imgur.com/hi5cD.png)\
[Share](https://stackoverflow.com/a/65047764)[Improve this answer](https://stackoverflow.com/posts/65047764/edit)Followanswered Nov 28 '20 at 8:28[![](https://lh5.googleusercontent.com/-3GBYjFTHD5o/AAAAAAAAAAI/AAAAAAAACIg/5zJMMABQnZM/photo.jpg?sz=32)](https://stackoverflow.com/users/4473224/rasul-ebrahimzadeh)[Rasul Ebrahimzadeh](https://stackoverflow.com/users/4473224/rasul-ebrahimzadeh)8711 silver badge99 bronze badges

* Changing port worked for me and no other method worked – [Zobia Kanwal](https://stackoverflow.com/users/10736243/zobia-kanwal) [Dec 18 '20 at 13:09](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment115546811_65047764)

[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)4

Here is what I did. I restarted my computer. Next I run services.msc. I stopped the MySQL service then restarted it. The restarted the Xampp server.[Share](https://stackoverflow.com/a/41594528)[Improve this answer](https://stackoverflow.com/posts/41594528/edit)Followanswered Jan 11 '17 at 15:18[![](https://i.stack.imgur.com/gqaDV.jpg?s=32\&g=1)](https://stackoverflow.com/users/315683/kyzen)[kyzen](https://stackoverflow.com/users/315683/kyzen)18511 gold badge11 silver badge1313 bronze badges

* This is not a valid answer! – [abhiarora](https://stackoverflow.com/users/5735010/abhiarora) [Jan 11 '17 at 15:37](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment70392628_41594528)
* Not valid answer – [Soumyajit Dutta](https://stackoverflow.com/users/4639952/soumyajit-dutta) [Aug 1 '19 at 15:10](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment101116318_41594528)

[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)4

No solution above worked for me. then I did below:

I deleted all the files inside C:\xampp\mysql\data\ directory except folders in this directory. It worked perfectly fine but my previous databases are not working now. So do above if you don't care it will delete all your previous databases in phpmyadmin.[Share](https://stackoverflow.com/a/41698533)[Improve this answer](https://stackoverflow.com/posts/41698533/edit)Followanswered Jan 17 '17 at 13:33[![](https://graph.facebook.com/517087671805469/picture?type=large)](https://stackoverflow.com/users/5534480/aammad-ullah)[Aammad Ullah](https://stackoverflow.com/users/5534480/aammad-ullah)23633 silver badges1111 bronze badges[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)3

i was facing the same issue and none of the solutions stated above helped me. i went to the mysql configuration file (my.ini) and changed the port number under \[mysqld].By default mysql runs on 3306 port.

```
port= 3306
```

i changed it to ,

```
port= 8111
```

Then run as Administrator.Finally this worked for me.[Share](https://stackoverflow.com/a/49485971)[Improve this answer](https://stackoverflow.com/posts/49485971/edit)Followanswered Mar 26 '18 at 7:24[![](https://graph.facebook.com/827436734026643/picture?type=large)](https://stackoverflow.com/users/7138410/sksaif-uddin)[Sksaif Uddin](https://stackoverflow.com/users/7138410/sksaif-uddin)3971010 silver badges1818 bronze badges[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)3

I have resolved the problem by ending the task for mysqlid on Task Manager.[![enter image description here](https://i.stack.imgur.com/lk2xN.jpg)](https://i.stack.imgur.com/lk2xN.jpg)[Share](https://stackoverflow.com/a/59369024)[Improve this answer](https://stackoverflow.com/posts/59369024/edit)Followanswered Dec 17 '19 at 6:56[![](https://i.stack.imgur.com/lQPUt.jpg?s=32\&g=1)](https://stackoverflow.com/users/9038027/mandeep-singh-gill)[Mandeep Singh Gill](https://stackoverflow.com/users/9038027/mandeep-singh-gill)53944 silver badges44 bronze badges

* Thanks, it helped me. That soultion with deleting ib1 created for me new problems to solve. – [Skotee](https://stackoverflow.com/users/7794282/skotee) [Feb 17 '20 at 0:21](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment106579997_59369024)

[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)3

I solved similar MySQL error & I think this answer will help you to fix the same type of MySQL database error. [![MySQL Error on XAMPP Control panel](https://i.stack.imgur.com/wS8Fg.jpg)](https://i.stack.imgur.com/wS8Fg.jpg)

**Solution:**

* Go to the “data” directory in the mysql database.
* I installed XAMPP on D: drive on my computer & the mysql “data” directory location of my computer was “D:\xampp\mysql\data\”. You may have different location.

**Take Backup of MySQL “data” Folder**

* First of all you should create a backup of the “data” folder using any compression software.
* Give a name like “data\_backup.zip” or any type of compression you wish.
* I used winrar compression software to compress & backup mysql “data” folder.

**Rename the “data” folder**

* Rename the “data” folder to “data-oldfiles”. This is very important to rename the data directory to any new directory name.

**Create a new “data” folder**

* Create a new folder and give the folder name as “data“
* To solve the problem we need to create a new “data” directory in the mysql database.

**Copy content from “backup” folder**

* Go to the “backup” folder and copy all files.
* Paste the files from backup folder to data folder
* Now start the MySQL database from XAMPP.
* Your MySQL database will start properly without showing any error.

**Transfer all MySQL projects Database, Data file & Log files**

* If you have many database which was used for various projects, then you have to transfer all database from “data-oldfiles” folder to “data” folder.
* Copy all databases from the data-old files and paste to the data folder.
* Now you have to copy the data file “ibdata1” & all log files “ib\_logfile0, ib\_logfile1 ” from data-old files folder to the data folder.
* If you have many id\_logiles then copied all of them.
* Now Start MySQL from XAMPP.
* Go to phpMyAdmin to check all databases are available & working.
* Now start your any website project from localhost to check the MySQL database.

**The Problem is solved !!**

[![MySQL Error solved on XAMPP](https://i.stack.imgur.com/vC0UD.png)](https://i.stack.imgur.com/vC0UD.png)

* Now you will see the problem is solved and the error message “Error: MySQL shutdown unexpectedly.” will not show again.
* If you have any question on this issue please feel free to ask any question in the comments section.

You can read the details tutorials on the link bellow: [Error: MySQL shutdown unexpectedly – Solution in 5 easy steps](https://www.progschools.com/database/mysql/error-mysql-shutdown-unexpectedly/)

You can also watch video tutorials to solve the problem:

[\[Solved\] Error: MySQL shutdown unexpectedly](https://www.youtube.com/watch?v=ANdFThQIilQ\&t=53s)[Share](https://stackoverflow.com/a/63080034)[Improve this answer](https://stackoverflow.com/posts/63080034/edit)Follow[edited Jul 24 '20 at 19:15](https://stackoverflow.com/posts/63080034/revisions)answered Jul 24 '20 at 19:06[![](https://www.gravatar.com/avatar/e7760aad900295c85b999c0004a037e8?s=32\&d=identicon\&r=PG)](https://stackoverflow.com/users/3492326/shafiq2410)[shafiq2410](https://stackoverflow.com/users/3492326/shafiq2410)5133 bronze badges[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)2

Guys just make sure you dont have MySql Server installed. Because I have MySql server pre-installed and when I start mysql from xampp control panel some port conflicts are happening and its not working.. SO before starting the mysql from xampp control panel make sure mysql server is not installed. I use .net so I have installed mysql server in the Past. Uninstalling it solved my Problem....[Share](https://stackoverflow.com/a/50324983)[Improve this answer](https://stackoverflow.com/posts/50324983/edit)Followanswered May 14 '18 at 7:24[![](https://lh3.googleusercontent.com/-7EZ7yTlptnw/AAAAAAAAAAI/AAAAAAAAAlk/e6JOnR_ahmM/photo.jpg?sz=32)](https://stackoverflow.com/users/7737777/gvs-akhil)[Gvs Akhil](https://stackoverflow.com/users/7737777/gvs-akhil)1,46411 gold badge1111 silver badges2424 bronze badges[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)2

```
0.cntr+alt+delet
1.end task mysqld
2.Restart mysql.
```

[![](https://i.stack.imgur.com/a1URi.png)](https://i.stack.imgur.com/a1URi.png)[Share](https://stackoverflow.com/a/60837106)[Improve this answer](https://stackoverflow.com/posts/60837106/edit)Followanswered Mar 24 '20 at 18:26[![](https://lh6.googleusercontent.com/-PIPH3Dqhmo0/AAAAAAAAAAI/AAAAAAAAACU/5zdhZ6IiV7M/photo.jpg?sz=32)](https://stackoverflow.com/users/6742006/%d8%b3%db%8c%d8%af%d8%b1%d8%b3%d9%88%d9%84-%d9%85%db%8c%d8%b1%d8%b9%d8%b8%db%8c%d9%85%db%8c)[سیدرسول میرعظیمی](https://stackoverflow.com/users/6742006/%d8%b3%db%8c%d8%af%d8%b1%d8%b3%d9%88%d9%84-%d9%85%db%8c%d8%b1%d8%b9%d8%b8%db%8c%d9%85%db%8c)47455 silver badges1010 bronze badges[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)2

What worked for me is:

1. First I open `Logs` for `MySql` in `XAMPP panel`.
2. At the end it says you are running another instance of mysqlid in port `3306`
3. I opened my `task manager(Ctrl+Shift+Esc)` then find `mysqlid` and `End the task`.

[Share](https://stackoverflow.com/a/63201796)[Improve this answer](https://stackoverflow.com/posts/63201796/edit)Followanswered Aug 1 '20 at 4:32[![](https://lh5.googleusercontent.com/-deI3UI3nrbQ/AAAAAAAAAAI/AAAAAAAAAFo/pFEEVBRdTBE/photo.jpg?sz=32)](https://stackoverflow.com/users/11073769/shibashis)[shibashis](https://stackoverflow.com/users/11073769/shibashis)3566 bronze badges[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)2

I had encountered the same issue, but all I had to do was close the XAMPP Control panel, go to the folder in which XAMPP is installed, find xampp-control.exe and run as administrator and then start the services.

[![enter image description here](https://i.stack.imgur.com/0INNQ.jpg)](https://i.stack.imgur.com/0INNQ.jpg)[Share](https://stackoverflow.com/a/65278940)[Improve this answer](https://stackoverflow.com/posts/65278940/edit)Follow[edited Dec 13 '20 at 18:09](https://stackoverflow.com/posts/65278940/revisions)answered Dec 13 '20 at 18:04[![](https://www.gravatar.com/avatar/e066fb1fa09ea764779034c35825df40?s=32\&d=identicon\&r=PG)](https://stackoverflow.com/users/14001406/curious)[Curious](https://stackoverflow.com/users/14001406/curious)10611 silver badge44 bronze badges[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)1

Config->Apache->Open httpd.conf. search for Listen or 80,update listen port to 8081 save and restart server. Oh and shutdown Skype if you have it.[Share](https://stackoverflow.com/a/18023223)[Improve this answer](https://stackoverflow.com/posts/18023223/edit)Followanswered Aug 2 '13 at 17:56[![](https://i.stack.imgur.com/NYFQg.jpg?s=32\&g=1)](https://stackoverflow.com/users/1745672/mihai)[Mihai](https://stackoverflow.com/users/1745672/mihai)22.9k77 gold badges5757 silver badges7272 bronze badges

* 2Yeah, that fixed it. I swear I reinstalled before posting that, but I guess not. Thanks :) – [Austin](https://stackoverflow.com/users/2646822/austin) [Aug 3 '13 at 21:01](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment26386354_18023223)

[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)1

In my case in which I synced my mysql data and htdocs to dropbox, I just needed to delete the conflicted files in mysql/data folder and subfolders. The conflicted files can be identified by its names, dropbox will tell you that. It has solved the problem for me.[Share](https://stackoverflow.com/a/27885554)[Improve this answer](https://stackoverflow.com/posts/27885554/edit)Followanswered Jan 11 '15 at 9:15[![](https://www.gravatar.com/avatar/db0e164a2f79a9cbe4295f54299f7333?s=32\&d=identicon\&r=PG)](https://stackoverflow.com/users/2927317/maurisrx)[maurisrx](https://stackoverflow.com/users/2927317/maurisrx)30933 silver badges99 bronze badges[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)1

Make sure the system time is correct. Mine was set to the year 2040 somehow, correcting the date solved the problem.[Share](https://stackoverflow.com/a/41327101)[Improve this answer](https://stackoverflow.com/posts/41327101/edit)Follow[edited Dec 26 '16 at 9:17](https://stackoverflow.com/posts/41327101/revisions)[![](https://www.gravatar.com/avatar/a0f53578503d0cb49e4f39b1d4b8f2d7?s=32\&d=identicon\&r=PG\&f=1)](https://stackoverflow.com/users/247702/user247702)[user247702](https://stackoverflow.com/users/247702/user247702)21.8k1313 gold badges101101 silver badges145145 bronze badgesanswered Dec 26 '16 at 6:11[![](https://i.stack.imgur.com/7UEZx.png?s=32\&g=1)](https://stackoverflow.com/users/3490640/shakee93)[shakee93](https://stackoverflow.com/users/3490640/shakee93)3,73922 gold badges2323 silver badges2929 bronze badges[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)1

For me I quit Skype, which was occupying port 80, then Apache ran happily on port 80, than I ran Skype and it picked another port this time.[Share](https://stackoverflow.com/a/31101785)[Improve this answer](https://stackoverflow.com/posts/31101785/edit)Follow[edited May 14 '17 at 3:20](https://stackoverflow.com/posts/31101785/revisions)[![](https://i.stack.imgur.com/jld81.jpg?s=32\&g=1)](https://stackoverflow.com/users/2524730/tiffany)[Tiffany](https://stackoverflow.com/users/2524730/tiffany)6091111 silver badges2626 bronze badgesanswered Jun 28 '15 at 15:57[![](https://www.gravatar.com/avatar/332e30868251debf10251dc0dc11822b?s=32\&d=identicon\&r=PG)](https://stackoverflow.com/users/1957956/sudhanshu)[sudhanshu](https://stackoverflow.com/users/1957956/sudhanshu)33366 silver badges2121 bronze badges[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)1

if you are using MariaDB you can try this:

1. Go to mysql/data/
2. Rename **aria\_log\_control** to **aria\_log\_control\_old**
3. Restart "Mysql"

[Share](https://stackoverflow.com/a/49537939)[Improve this answer](https://stackoverflow.com/posts/49537939/edit)Followanswered Mar 28 '18 at 15:00[![](https://www.gravatar.com/avatar/73b6052831aa3b150c7a087776032db8?s=32\&d=identicon\&r=PG)](https://stackoverflow.com/users/184697/leo)[Leo](https://stackoverflow.com/users/184697/leo)1,58333 gold badges1616 silver badges2323 bronze badges[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)1

i comment this statement in mysql/bin/my.ini

```
'innodb_additional_mem_pool_size=2M'
```

and it solve my problem. than you everyOne[Share](https://stackoverflow.com/a/50944335)[Improve this answer](https://stackoverflow.com/posts/50944335/edit)Followanswered Jun 20 '18 at 9:05[![](https://i.stack.imgur.com/K4xIH.jpg?s=32\&g=1)](https://stackoverflow.com/users/7777105/boston-kenne)[Boston Kenne](https://stackoverflow.com/users/7777105/boston-kenne)62099 silver badges1212 bronze badges

* I don't have that line at all – [Vipul Hadiya](https://stackoverflow.com/users/3849124/vipul-hadiya) [Sep 11 '19 at 6:06](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment102188732_50944335)
* Are you on windows ? what is your xampp version ? – [Boston Kenne](https://stackoverflow.com/users/7777105/boston-kenne) [Sep 11 '19 at 7:07](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment102190159_50944335)
* Yes, Win 10 with XAMPP 3.2.4 – [Vipul Hadiya](https://stackoverflow.com/users/3849124/vipul-hadiya) [Sep 11 '19 at 7:09](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment102190198_50944335)
* did you have access to your mysql/bin/my.ini file? – [Boston Kenne](https://stackoverflow.com/users/7777105/boston-kenne) [Sep 11 '19 at 8:09](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment102191926_50944335)
* [gist.github.com/susanBuck/52f8a8508d94834332b1d565fb3a0e00](https://gist.github.com/susanBuck/52f8a8508d94834332b1d565fb3a0e00) see this link, and check your file location that it's supposed to be in C:\xampp\mysql\bin\my.ini , find the line innodb\_additional\_mem\_pool\_size and comment it. – [Boston Kenne](https://stackoverflow.com/users/7777105/boston-kenne) [Sep 11 '19 at 8:16](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#comment102192137_50944335)

[Add a comment](https://stackoverflow.com/questions/18022809/xampp-mysql-shutdown-unexpectedly#)1

This means that you already have a MySQL database running at port 3306.

In the XAMPP control panel, press the 'Config' button and after that press 'my.ini'. After this, Ctrl-F and search for '3306'. Replace any '3306' that you find with a different port number of your choice (you could choose 3307 or 3308 - I chose 2811 and it worked).

After you have replaced every location where '3306' is written, save the file and press 'Start' on the control panel again.[Share](https://stackoverflow.com/a/53083691)[Improve this answer](https://stackoverflow.com/posts/53083691/edit)Followanswered Oct 31 '18 at 12:46[<br>](https://stackoverflow.com/users/7582732/leo-chashchin)
