0

I was working on xampp server. I have done my work yesterday and open my system today. Now, when I start MySQL from Xampp control panel then receive errors

 Error: MySQL shutdown unexpectedly.
5:49:38 PM  [mysql]     This may be due to a blocked port, missing dependencies, 
5:49:38 PM  [mysql]     improper privileges, a crash, or a shutdown by another method.
5:49:38 PM  [mysql]     Press the Logs button to view error logs and check
5:49:38 PM  [mysql]     the Windows Event Viewer for more clues
5:49:38 PM  [mysql]     If you need more help, copy and post this
5:49:38 PM  [mysql]     entire log window on the forums

MYSQL log file - MYSQL errors

2021-08-23 17:49:35 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2021-08-23 17:49:35 0 [Note] InnoDB: Uses event mutexes
2021-08-23 17:49:35 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-08-23 17:49:35 0 [Note] InnoDB: Number of pools: 1
2021-08-23 17:49:35 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-08-23 17:49:35 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2021-08-23 17:49:35 0 [Note] InnoDB: Completed initialization of buffer pool
2021-08-23 17:49:36 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-08-23 17:49:36 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-08-23 17:49:36 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-08-23 17:49:36 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2021-08-23 17:49:36 0 [Note] InnoDB: Waiting for purge to start
2021-08-23 17:49:36 0 [Note] InnoDB: 10.4.13 started; log sequence number 47242; transaction id 9
2021-08-23 17:49:36 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2021-08-23 17:49:36 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-08-23 17:49:36 0 [Note] InnoDB: Buffer pool(s) load completed at 210823 17:49:36
2021-08-23 17:49:36 0 [Note] Server socket created on IP: '::'.

It was working cool yesterday. I didn't do anything yesterday. I tried solution - XAMPP - MySQL shutdown unexpectedly After tried the solution, It's working but many tables do not exist in the engine. Like - Table 'database.meditemimg' doesn't exist in engine I have 10 tables in my database. Three tables exist but 7 tables do not exist after applied this method -

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 

The collation changed to in use for 7 tables.

Is there another way to fix MySQL shutdown error ?

Shiva
  • 81
  • 7
  • 1
    your log shows a running server and no error where logged, so maybe the server rebotteor made an update – nbk Aug 23 '21 at 12:46
  • Ok now, How can I get my data to save and fix the MySQL shutdown error? – Shiva Aug 23 '21 at 12:48
  • your server is running, acording to the log you shown, so a simple mysq - root -p works. you can chekc the saystem logs to see if there was a problem, but you can access yourdata – nbk Aug 23 '21 at 12:52
  • How to do that? I am not getting it. – Shiva Aug 23 '21 at 12:59
  • windows has an event viewer, where everything is logged look for the time of the shutdown if there is something unusual and make always backups, so that in all cases you restore a working dataabse – nbk Aug 23 '21 at 13:02
  • I have taken the backup of my folder MySQL. I have seen windows event viewer. There are many errors showing in local - MariaDB has 24 errors in the last hour. Also other apps. how can I fix that ? – Shiva Aug 23 '21 at 13:14
  • that is no programming question , yu could try it at superuser, but you can already look up he erros by lookkin g at the deatil and search for it, also you should chekcm the harddrive for errors – nbk Aug 23 '21 at 13:20
  • ok, I'll try myself. – Shiva Aug 23 '21 at 13:22
  • did you pay attention to these sections? 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 – Mehdi Zamani Aug 31 '21 at 11:47

2 Answers2

0

Extend buffer size related values on my.ini from mysql/bin

Answer is here - https://stackoverflow.com/a/72721411/3178959

  • Please explain your answer. Give a summary here. – Rohit Gupta Jun 27 '22 at 13:37
  • I have change my answer for the explanation. Main issue that I faced is, some of my database size is to high. But ibdata1 can not be auto extended. Removing ibdata1 and replacing mysql data is not the permanent solution. So I did those step and my error was fixed. steps are in the link that I had shared. – Hossain Md Awlad Jul 07 '22 at 07:55
0

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

  1. Rename folder mysql/data to mysql/data_old
  2. Make a copy of mysql/backup folder and name it as mysql/data
  3. Copy all your database folders from mysql/data_old into mysql/data (except mysql, performance_schema, and phpmyadmin folders)
  4. Copy mysql/data_old/ibdata1 file into mysql/data folder
  5. Start MySQL from XAMPP control panel
Tarik Benali
  • 47
  • 1
  • 7