This Bash script automates the process of fixing MySQL database issues on XAMPP by renaming folders and copying necessary files. Ensure you have backup folder in the same directory as mysql
try commend or uncomment the copy of ibdata1 if you still revice any error
CAUTION: IF YOU DELETE IBDATA1 YOULL LOSE YOUR TABLE frurther reference: https://stackoverflow.com/questions/21279442/xampp-mysql-not-starting-attempting-to-start-mysql-service
https://stackoverflow.com/questions/18022809/how-can-i-solve-error-mysql-shutdown-unexpectedly
- Download the script to your local machine.
- Open the script in a text editor and customize the
base_path
variable to match your XAMPP Mysql installation directory. - Make you have bash cmd (can be obtained by installing git)
- Run the script using
./script_name.sh
.
- Renames the existing
data
folder todata_old
. - Creates a new
data
folder. - Copies contents from the
backup
folder to the newdata
folder. - Copies necessary database folders from
data_old
todata
(excludingmysql
,performance_schema
, andphpmyadmin
). - Copies the
ibdata1
file fromdata_old
todata
.
- Provides feedback on script execution status.
- Bash shell environment.
- XAMPP installed on your system.
This project is licensed under the MIT License - see the LICENSE file for details.