Keep dump/backup of all databases.This is not 100% reliable process.
Manual backup: Go to datadir path (see in my.ini file) and copy all databases.sql files from data folder
This error will be thrown when unexpectedly MySql service is stopped or disabled
and not able to restart in the Services.
First try restart PC and MySql Service couple of times ,if still getting same error then follow the steps.
Keep open the following wizards and folders:
C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin
C:\Program Files (x86)\MySQL\MySQL Server 5.5
Services list ->select MySql Service.
Go to installed folder MySql, double-click on instance config
C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin\MySqlInstanceConfig.exe
Then select remove instance and click on next to remove non-working MySql service instance.
See in the Service list (refresh F5) where MySql service should not be found.
Now go to C:\Program Files (x86)\MySQL\MySQL Server 5.5
open my.ini file check below
#Path to installation directory
basedir="C:/Program Files (x86)/MySQL/MySQL Server 5.5/"
#Path to data directory
datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/"
Choose data dir Go to "C:/ProgramData/MySQL/MySQL Server 5.5/Data/"
It contains all tables data and log info, ib data, user.err,user.pid .
Delete
log files,
ib data,
user.err,
user.pid files.
(why because to create new MySql instance or when reconfiguring MySql service by clicking on MySqlInstanceConfig.exe and selecting default configure, after enter choosing password and clicking on execute the wizard will try to create these log files or will try to append the text again to these log files and other files which will make the setup wizard as unresponding and finally end up with configuration not done).
After deleted selected files from C:/ProgramData/MySQL/MySQL Server 5.5/Data/
go to C:\Program Files (x86)\MySQL\MySQL Server 5.5
Delete the selected files my.ini and and other .bak format files which cause for the instance config.exe un-responding.
C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin\MySqlInstanceConfig.exe
Select MySqlInstanceConfig.exe and double-click on it and select default configuration or do the regular set up that we do when installing MySql server first time.