Cách sửa lỗi error: mysql shutdown unexpectedly trên XAMPP

Được tạo bởi Hiển Nguyễn Góc học tập 20/04/2025
Chia sẻ

Lỗi MySQL Shutdown Unexpectedly xảy ra trên MySQL – hệ thống quản lý cơ sở dữ liệu phổ biến, được sử dụng rộng rãi trong phát triển web. Khi dùng XAMPP để phát triển và kiểm thử ứng dụng web trên máy tính cá nhân, người dùng có thể gặp thông báo này. Bài viết sau của TopStudy sẽ hướng dẫn cách khắc phục lỗi trên.

Rất quan trọng: KHÔNG được xóa file (tệp) ibdata1 trong
C:\xampp\mysql\data. Việc này có thể làm mất toàn bộ cơ sở dữ liệu của bạn.

Hãy thực hiện các bước sau:

 Bước 1: Đổi tên thư mục mysql/data thành mysql/data1.

Bước 2: Sao chép thư mục mysql/backup ra DESTOP và đổi tên bản sao
thành data

Bước 3: Copy thư mục data trên DESTOP vào C:\xampp\mysql\.

Bước 4: Sao chép tất cả các thư mục cơ sở dữ liệu bạn tạo cho
website của mình từ mysql/data1 vào mysql/data (ngoại trừ các thư mục mysql,
performance_schema và phpmyadmin); Và sao chép file (tệp) ibdata1 từ mysql/data1 vào mysql/data.

Bước 5: Khởi động MySQL từ bảng điều khiển XAMPP.

Lưu ý: Sau khi hoàn thành 5 bước trên, nếu website của bạn sử dụng CMS Wordpress, bạn cần
truy cập vào admin, chọn Cài đặt, chọn Đường dẫn cố định và chọn lại đường dẫn
rồi lưu lại.

 Very important: Do NOT delete the ibdata1 file in
C:\xampp\mysql\data. Doing so will result in the complete destruction of your
databases.

Instead, attempt recovery by utilizing the MySQL backup
folder provided within XAMPP. Follow these steps meticulously:

Rename the mysql/data folder to mysql/data1.

This preserves your existing data as a precaution.

Create a copy of the mysql/backup folder and rename the copy
to mysql/data.

This establishes a fresh data directory from the backup.

Transfer all your database folders from mysql/data1 into
mysql/data, excluding the mysql, performance_schema, and phpmyadmin folders.

These excluded folders contain system data and should not be
overwritten.

Copy the file ibdata1 in mysql/data1/ into the mysql/data
folder.

This file is essential for database table and index data
recovery.

Start the MySQL service from the XAMPP Control Panel. Once
these steps are completed, verify the successful restoration of your databases.

 All Done!

Nhận xét (0)

Chia sẻ

Share this post with others