Search code examples
mariadbxampp

Error: MySQL shutdown unexpectedly. (i have read all ansewrs but i have deafferent situation im clreafing this thos how think i dont see others)


First i Check MySQL Error Log

  • after i go to the “data” directory in the mysql database
  • I rename “data” folder by "data-old" and creat other one in same path i named "data" Then i remove the content of "data-old" and i go to ''backup'' folder i dont found all the contententer image description here

then i go to reciacle and i found all the data i remove and i recover 'data' folder and start xampp and still problem extist.

  • Then i change port from 3306 to 3307 in file my.ini and start appache and mysql and mysql have same problem
  • then i found comand solve proble and run it the comand .\setup_xampp.bat
   C:\xampp ❯ .\setup_xampp.bat
################################# START XAMPP TEST SECTION #################################
[XAMPP]: Test php.exe with php\php.exe -n -d output_buffering=0 --version ...
PHP 8.2.12 (cli) (built: Oct 24 2023 21:15:15) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.2.12, Copyright (c) Zend Technologies
[XAMPP]: Test for the php.exe successfully passed. Good!
################################# END XAMPP TEST SECTION ###################################


  ########################################################################
  # ApacheFriends XAMPP setup win32 Version                              #
  #----------------------------------------------------------------------#
  # Copyright (c) 2002-2025 Apachefriends 8.2.12
                          #
  #----------------------------------------------------------------------#
  # Authors: Kay Vogelgesang <kvo@apachefriends.org>                     #
  #          Carsten Wiedmann <webmaster@wiedmann-online.de>             #
  ########################################################################



 Sorry, but ... nothing to do!


Press any key to continue . . .
C:\xampp ❯

and i run xampp nothing change please if you have any idea to solve problem tell me and other thing this file mysql_error.log


2025-01-27 20:36:54 0 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2025-01-27 20:36:54 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2025-01-27 20:36:54 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\phpmyadmin\pma__central_columns.ibd' OS error: 71
2025-01-27 20:36:54 0 [ERROR] InnoDB: Operating system error number 203 in a file operation.
2025-01-27 20:36:54 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2025-01-27 20:36:54 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``phpmyadmin`.`pma__central_columns``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.

2025-01-28 12:46:41 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2025-01-28 12:46:41 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2025-01-28 12:46:41 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2025-01-28 12:46:41 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2025-01-28 12:46:41 0 [Note] InnoDB: Waiting for purge to start
2025-01-28 12:46:41 0 [Note] InnoDB: 10.4.32 started; log sequence number 747295; transaction id 1392
2025-01-28 12:46:41 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2025-01-28 12:46:41 0 [Note] Plugin 'FEEDBACK' is disabled.
2025-01-28 12:46:41 0 [Note] InnoDB: Buffer pool(s) load completed at 250128 12:46:41
2025-01-28 12:46:41 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2025-01-28 12:46:41 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
2025-01-28 12:46:41 0 [Note] Server socket created on IP: '::'.

Solution

  • The errors indicate missing/corrupted system tables (e.g., mysql.servers). Here's how to fix this:

    => Ensure Apache and MySQL are stopped via the XAMPP Control Panel.

    => Move the current data folder (e.g., rename to data-bak) located at C:\xampp\mysql\data to preserve any existing databases.

    => Delete the original data folder (not the backup).

    => Open a command prompt in C:\xampp\mysql\bin and run:

    mysqld --initialize-insecure --user=mysql
    

    This creates a fresh data folder with default system tables.

    => Copy your database folders (e.g., phpmyadmin, your_database) from data-bak into the new data directory. Do not overwrite system tables (e.g., mysql, performance_schema).

    => Fix Permissions: Ensure the data folder and its contents have full read/write permissions for the MySQL service.

    => Start MySQL: Launch MySQL via the XAMPP Control Panel. Check the error logs again to confirm resolution.