• Skip to main content
  • Skip to primary sidebar
  • Home
  • WordPress
  • web Hosting
  • linux
  • mysql
  • nginx
  • apache2
  • devops

Raju Ginni

wordpress tutorials seo hosting etc

XAMPP MySQL problems and their fixes

August 13, 2025 By Raju Ginne

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

 

Table of Contents

Toggle
      • 2. Corrupted ibdata1 file 📁
  • temporary solution
  • permanent solution
  • 1. MySQL Won’t Start
  • 2. MySQL Service Not Installed
  • 3. Access Denied for Root User
  • 4. phpMyAdmin “Cannot Connect: Invalid Settings”
  • 5. Table Crashes or Corruption
  • 6. MySQL Keeps Crashing
  • 7. Import Errors in phpMyAdmin (File Too Large)

2. Corrupted ibdata1 file 📁

 

The ibdata1 file is crucial for InnoDB, the storage engine MariaDB uses. If this file becomes corrupted, MariaDB can fail to start. The log you provided shows that the server is successfully starting “crash recovery,” which suggests there may be an issue with the data files that requires attention.

Solution: This is a more drastic solution, so only attempt it if the port conflict solution doesn’t work.

  1. Back up your databases first! 💾 This is critically important to prevent data loss. Copy your entire C:\wamp\mysql\data folder to a safe location.
  2. Stop all WampServer services. Make sure the Wamp icon is red.
  3. Go to C:\wamp\mysql\data.
  4. Delete all files except for the folders corresponding to your databases. You should keep your database folders and the mysql, performance_schema, and phpmyadmin folders.
  5. Try starting WampServer again. The ibdata1 file will be recreated automatically, which should fix the corruption issue.

 

temporary solution

  1. Make a backup for this folder C:\xampp\mysql\data (make sure your backup folder’s name is not backup) .
  2. Now Copy all files/folders from C:\xampp\mysql\backup except ibdata1 to avoid error of table does not exist .
  3. Paste all copied files/folders to C:\xampp\mysql\data

permanent solution

Increase memory in my.ini:  innodb_buffer_pool_size=512M

innodb_data_file_path=ibdata1:60M:autoextend
innodb_log_group_home_dir=”C:/wamp/mysql/data”
#innodb_log_arch_dir = “C:/wamp/mysql/data”
## You can set .._buffer_pool_size up to 50 – 80 %
## of RAM but beware of setting memory usage too high
innodb_buffer_pool_size=256M

[ERROR] InnoDB: The Auto-extending innodb_system data file ‘C:\wamp\mysql\data\ibdata1′ is of a different size 768 pages than specified in the .cnf file: initial 3840 pages, max 0 (relevant if non-zero) pages!  reverted to innodb_data_file_path=ibdata1:10M:autoextend

restart mysql

Open your my.conf from xampp/mysql/bin/my.conf and find this two lines.

innodb_buffer_pool_size=10M

change this to 30M 0r 50MB. and than

innodb_data_file_path=ibdata1:20M:autoextend

change this too

innodb_data_file_path=ibdata1:60M:autoextend

1. MySQL Won’t Start

Symptoms:

  • You click Start in XAMPP, it turns green briefly, then stops.

  • Error log shows Port 3306 in use or Can't open socket.

Fixes:

  • Check Port Conflict

    • In XAMPP Control Panel → Config → Service and Port Settings → MySQL tab → Change port from 3306 to 3307 (or another free port).

    • Save and restart XAMPP.

  • Stop Conflicting Services

    • Often Skype, MySQL service from other installations, or WAMP uses 3306.

    • In Command Prompt (Admin):

      bash
      netstat -ano | findstr 3306
      taskkill /PID <PID> /F
  • Remove Multiple MySQL Instances

    • Uninstall other MySQL server packages or disable them in Windows Services (services.msc).


2. MySQL Service Not Installed

Symptoms:

  • Error: mysqld.exe not found or service missing.

Fixes:

  • In XAMPP Control Panel → Shell → run:

    bash
    mysqld --install
  • Or reinstall XAMPP MySQL component without deleting your mysql/data folder.


3. Access Denied for Root User

Symptoms:

  • Error: ERROR 1045 (28000): Access denied for user 'root'@'localhost'.

Fixes:

  • Stop MySQL in XAMPP.

  • Edit my.ini (XAMPP → mysql → bin) → under [mysqld] add:

    sql
    skip-grant-tables
  • Start MySQL, open phpMyAdmin, and run:

    sql
    UPDATE mysql.user SET authentication_string=PASSWORD('your_new_password') WHERE User='root';
    FLUSH PRIVILEGES;
  • Remove skip-grant-tables and restart.


4. phpMyAdmin “Cannot Connect: Invalid Settings”

Fix:

  • In phpMyAdmin/config.inc.php, check:

    php
    $cfg['Servers'][$i]['host'] = '127.0.0.1';
    $cfg['Servers'][$i]['port'] = '3306';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = ''; // empty by default in XAMPP

5. Table Crashes or Corruption

Symptoms:

  • “Table doesn’t exist” or “#145 – Table was marked as crashed”.

Fixes:

  • In phpMyAdmin, select the database → tick the table → choose Repair table from dropdown.

  • Or from MySQL shell:

    sql
    REPAIR TABLE table_name;

6. MySQL Keeps Crashing

Possible Causes:

  • Bad plugins or corrupted ibdata1.

  • Large queries exhausting memory.

Fixes:

  • Backup mysql/data folder.

  • Delete ib_logfile0 and ib_logfile1 (will be recreated).  // sometimes not works

  • Check error logs at mysql/data/mysql_error.log.

  • Increase memory in my.ini:

    ini
    innodb_buffer_pool_size=512M

7. Import Errors in phpMyAdmin (File Too Large)

Fixes:

  • Edit php/php.ini and increase:

    ini
    upload_max_filesize = 256M
    post_max_size = 256M
    max_execution_time = 300
  • Restart Apache and MySQL.

About Raju Ginne

AMFI Registered mutual fund distributor based in Hyderabad. you may contact me for mutual funds SIP investments Whatsapp: 9966367675.
nism certified research analyst

Primary Sidebar

hi i am raju ginni, primalry i manage wordpress websites on GCP cloud platform as a cloud engineer, and create content on passionate things.
you can follow me on youtbe

© 2025 - All Rights Reserved Disclaimer & Privacy Policy