Cách sửa lỗi máy chủ MySQL không khởi động trong bảng điều khiển XAMPP. Nhật ký rất có thể sẽ thông báo tắt máy đột xuất hoặc “Chỉ mục cho bảng ‘. \mysql\user' bị hỏng;
Điều này đã xảy ra với tôi một vài lần với XAMPP, dường như là do dừng máy chủ MySQL trong bảng điều khiển
Đây là nhật ký lỗi của tôi khi cố khởi động máy chủ MySQL
3:43:26 PM [mysql] Attempting to start MySQL app... 3:43:26 PM [mysql] Status change detected: running 3:43:28 PM [mysql] Status change detected: stopped 3:43:28 PM [mysql] Error: MySQL shutdown unexpectedly. 3:43:28 PM [mysql] This may be due to a blocked port, missing dependencies, 3:43:28 PM [mysql] improper privileges, a crash, or a shutdown by another method. 3:43:28 PM [mysql] Press the Logs button to view error logs and check 3:43:28 PM [mysql] the Windows Event Viewer for more clues 3:43:28 PM [mysql] If you need more help, copy and post this 3:43:28 PM [mysql] entire log window on the forums
sửa chữa
Sửa lỗi máy chủ MySQL không khởi động trong XAMPP được thực hiện bằng cách hoàn nguyên các tệp dữ liệu trước khi phát hành
Điều hướng đến thư mục XAMPP MySQL của bạn [C:\xampp\mysql
]
Tạo một thư mục mới có tên là FIX_BACKUP
Sao chép
[Apache] Status change detected: running [Apache] Status change detected: stopped [Apache] Error: Apache shutdown unexpectedly. [Apache] This may be due to a blocked port, missing dependencies, [Apache] improper privileges, a crash, or a shutdown by another method. [Apache] Press the Logs button to view error logs and check [Apache] the Windows Event Viewer for more clues [Apache] If you need more help, copy and post this [Apache] entire log window on the forums0 và
[Apache] Status change detected: running [Apache] Status change detected: stopped [Apache] Error: Apache shutdown unexpectedly. [Apache] This may be due to a blocked port, missing dependencies, [Apache] improper privileges, a crash, or a shutdown by another method. [Apache] Press the Logs button to view error logs and check [Apache] the Windows Event Viewer for more clues [Apache] If you need more help, copy and post this [Apache] entire log window on the forums1 vào
[Apache] Status change detected: running [Apache] Status change detected: stopped [Apache] Error: Apache shutdown unexpectedly. [Apache] This may be due to a blocked port, missing dependencies, [Apache] improper privileges, a crash, or a shutdown by another method. [Apache] Press the Logs button to view error logs and check [Apache] the Windows Event Viewer for more clues [Apache] If you need more help, copy and post this [Apache] entire log window on the forums2
Dán nội dung của
[Apache] Status change detected: running [Apache] Status change detected: stopped [Apache] Error: Apache shutdown unexpectedly. [Apache] This may be due to a blocked port, missing dependencies, [Apache] improper privileges, a crash, or a shutdown by another method. [Apache] Press the Logs button to view error logs and check [Apache] the Windows Event Viewer for more clues [Apache] If you need more help, copy and post this [Apache] entire log window on the forums0 vào
[Apache] Status change detected: running [Apache] Status change detected: stopped [Apache] Error: Apache shutdown unexpectedly. [Apache] This may be due to a blocked port, missing dependencies, [Apache] improper privileges, a crash, or a shutdown by another method. [Apache] Press the Logs button to view error logs and check [Apache] the Windows Event Viewer for more clues [Apache] If you need more help, copy and post this [Apache] entire log window on the forums1 ghi đè lên tất cả các tệp
Cuối cùng sao chép tệp
[Apache] Status change detected: running [Apache] Status change detected: stopped [Apache] Error: Apache shutdown unexpectedly. [Apache] This may be due to a blocked port, missing dependencies, [Apache] improper privileges, a crash, or a shutdown by another method. [Apache] Press the Logs button to view error logs and check [Apache] the Windows Event Viewer for more clues [Apache] If you need more help, copy and post this [Apache] entire log window on the forums5 từ
[Apache] Status change detected: running [Apache] Status change detected: stopped [Apache] Error: Apache shutdown unexpectedly. [Apache] This may be due to a blocked port, missing dependencies, [Apache] improper privileges, a crash, or a shutdown by another method. [Apache] Press the Logs button to view error logs and check [Apache] the Windows Event Viewer for more clues [Apache] If you need more help, copy and post this [Apache] entire log window on the forums6 vào
[Apache] Status change detected: running [Apache] Status change detected: stopped [Apache] Error: Apache shutdown unexpectedly. [Apache] This may be due to a blocked port, missing dependencies, [Apache] improper privileges, a crash, or a shutdown by another method. [Apache] Press the Logs button to view error logs and check [Apache] the Windows Event Viewer for more clues [Apache] If you need more help, copy and post this [Apache] entire log window on the forums1 ghi đè lên tệp
Máy chủ MySQL của bạn bây giờ sẽ bắt đầu trong bảng điều khiển XAMPP
Bạn đang cố gắng sử dụng XAMPP để phát triển PHP. Nhưng khi bạn khởi động Apache, bạn gặp lỗi này. Khả năng là do cổng bị chặn. Trong video này, tôi sẽ chỉ cho bạn cách khắc phục lỗi đó bằng cách thay đổi cổng mà Apache sử dụng. Dưới video, tôi cung cấp hướng dẫn bằng văn bản
Cách sửa lỗi Port bị chặn trong XAMPP
Lỗi bạn đang gặp phải có thể đọc giống như thế này
[Apache] Status change detected: running [Apache] Status change detected: stopped [Apache] Error: Apache shutdown unexpectedly. [Apache] This may be due to a blocked port, missing dependencies, [Apache] improper privileges, a crash, or a shutdown by another method. [Apache] Press the Logs button to view error logs and check [Apache] the Windows Event Viewer for more clues [Apache] If you need more help, copy and post this [Apache] entire log window on the forums
Rất có thể lỗi là do cổng bị chặn và đó gần như chắc chắn là cổng 80. Một tùy chọn sẽ là tìm ứng dụng đang sử dụng cổng 80 [có thể là Skype] và thay đổi nó để sử dụng một số cổng khác. Nhưng bạn có thể không kiểm soát được điều đó. Trong trường hợp đó, bạn có thể thay đổi Apache để sử dụng một cổng khác. Đây là cách
XAMPP là một công cụ tuyệt vời dành cho các nhà phát triển web, những người cần chạy hoặc kiểm tra các ứng dụng web cục bộ trên máy tính của chính họ. Thật không may, vì nó chạy các ứng dụng trên ngăn xếp LAMP, xung đột có thể xảy ra, khiến một số ứng dụng trên XAMPP không thể chạy
Trong bài viết này, chúng ta sẽ khám phá những gì bạn có thể làm nếu dịch vụ MySQL của XAMPP không chạy trên nền tảng macOS
Thay vào đó, bạn đang tìm cách để XAMPP MySQL hoạt động trên Windows phải không? . Thay vào đó, hãy nhấp vào các liên kết đã nói ở trên nếu chúng là những gì bạn cần
- Vấn đề
- Nguyên nhân có thể và cách khắc phục
- Xung đột máy chủ MySQL
- Giết các quy trình MySQL hiện có bằng Terminal
- Thay đổi số cổng của MySQL
- Phần kết luận
1. Vấn đề
Nếu tất cả các chương trình máy chủ XAMPP của bạn đang chạy ngoại trừ Cơ sở dữ liệu MySQL [như hình bên dưới], thì bạn nên đọc bài viết này để tìm nguyên nhân và giải pháp khả thi cho sự cố của mình
Trong bảng điều khiển XAMPP của bạn, bạn có thể thấy văn bản sau, trong đó cơ sở dữ liệu MySQL đang bị kẹt và không thể khởi động
Stopping all servers... Stopping Apache Web Server... /Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd stopped Stopping ProFTPD... Checking syntax of configuration file /Applications/XAMPP/xamppfiles/proftpd/scripts/ctl.sh : proftpd stopped Restarting all servers... Starting MySQL Database...
Nếu bạn cố gắng truy cập phpMyAdmin qua
[Apache] Status change detected: running [Apache] Status change detected: stopped [Apache] Error: Apache shutdown unexpectedly. [Apache] This may be due to a blocked port, missing dependencies, [Apache] improper privileges, a crash, or a shutdown by another method. [Apache] Press the Logs button to view error logs and check [Apache] the Windows Event Viewer for more clues [Apache] If you need more help, copy and post this [Apache] entire log window on the forums8 khi Apache đã khởi động [và không khởi động mô-đun MySQL], bạn cũng sẽ thấy màn hình lỗi sau
2. Nguyên nhân có thể và cách khắc phục
Vì vậy, điều gì có thể gây ra lỗi được mô tả ở trên?
a. Xung đột máy chủ MySQL
Trên macOS của bạn, bạn có thể có nhiều phiên bản máy chủ MySQL đang chạy. Điều này có thể được gây ra bởi các ứng dụng khác [đối với e. g. SQL Workbench] chạy các phiên bản MySQL của riêng họ. Để khắc phục sự cố này, bạn cần dừng phiên bản khác của máy chủ MySQL
Đây là cách để làm như vậy
- Chuyển đến Ứng dụng → Tiện ích → Giám sát hoạt động
- Chọn tất cả quy trình
- Tìm kiếm sql bằng cách sử dụng hộp tìm kiếm
- Bạn sẽ thấy quy trình mysqld, nhấp đúp vào quy trình đó và nhấn Quit
- Sau khi hoàn tất khởi động lại mysql trong manager-osx và nó sẽ chạy
b. Giết các quy trình MySQL hiện có bằng Terminal
Thay vì sử dụng Trình giám sát hoạt động, bạn cũng có thể tìm và đóng các quy trình mysqld hiện có bằng Terminal của macOS
Ghi chú. Để chạy các lệnh sau, bạn cần có thể đăng nhập với tư cách người dùng
[Apache] Status change detected: running [Apache] Status change detected: stopped [Apache] Error: Apache shutdown unexpectedly. [Apache] This may be due to a blocked port, missing dependencies, [Apache] improper privileges, a crash, or a shutdown by another method. [Apache] Press the Logs button to view error logs and check [Apache] the Windows Event Viewer for more clues [Apache] If you need more help, copy and post this [Apache] entire log window on the forums9 trên macOS của mình. Đây là hướng dẫn [của Apple] về cách thực hiện việc này. https. //hỗ trợ. táo. com/en-us/HT204012
- Mở Terminal, dán lệnh này.
Stopping all servers... Stopping Apache Web Server... /Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd stopped Stopping ProFTPD... Checking syntax of configuration file /Applications/XAMPP/xamppfiles/proftpd/scripts/ctl.sh : proftpd stopped Restarting all servers... Starting MySQL Database...
0; - Sau đó sao chép và chèn lệnh tiếp theo này.
Stopping all servers... Stopping Apache Web Server... /Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd stopped Stopping ProFTPD... Checking syntax of configuration file /Applications/XAMPP/xamppfiles/proftpd/scripts/ctl.sh : proftpd stopped Restarting all servers... Starting MySQL Database...
1. Điều này sẽ cho bạn thấy các quy trình với mysql trong tên của nó - Sau khi lấy các tiến trình, bạn cần lấy ID tiến trình của các tiến trình có tên là
Stopping all servers... Stopping Apache Web Server... /Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd stopped Stopping ProFTPD... Checking syntax of configuration file /Applications/XAMPP/xamppfiles/proftpd/scripts/ctl.sh : proftpd stopped Restarting all servers... Starting MySQL Database...
2. Trong trường hợp của tôi, quy trình có tên làStopping all servers... Stopping Apache Web Server... /Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd stopped Stopping ProFTPD... Checking syntax of configuration file /Applications/XAMPP/xamppfiles/proftpd/scripts/ctl.sh : proftpd stopped Restarting all servers... Starting MySQL Database...
3, vì vậy tôi cần có ID quy trình là 362 [được đánh dấu bên dưới]
root 8006 0.0 0.0 408628336 1648 s000 S+ 11:37AM 0:00.00 grep mysql _mysql 362 0.0 0.0 35192992 3396 ?? Ss Sun10PM 0:21.82 /usr/local/mysql/bin/mysqld --user=_mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --log-error=/usr/local/mysql/data/mysqld.local.err --pid-file=/usr/local/mysql/data/mysqld.local.pid --keyring-file-data=/usr/local/mysql/keyring/keyring --early-plugin-load=keyring_file=keyring_file.so
- Bây giờ, bạn cần kết thúc quá trình này bằng cách sử dụng lệnh sau.
root 8006 0.0 0.0 408628336 1648 s000 S+ 11:37AM 0:00.00 grep mysql _mysql 362 0.0 0.0 35192992 3396 ?? Ss Sun10PM 0:21.82 /usr/local/mysql/bin/mysqld --user=_mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --log-error=/usr/local/mysql/data/mysqld.local.err --pid-file=/usr/local/mysql/data/mysqld.local.pid --keyring-file-data=/usr/local/mysql/keyring/keyring --early-plugin-load=keyring_file=keyring_file.so
0, vì vậy đối với tôi lệnh cuối cùng sẽ là.root 8006 0.0 0.0 408628336 1648 s000 S+ 11:37AM 0:00.00 grep mysql _mysql 362 0.0 0.0 35192992 3396 ?? Ss Sun10PM 0:21.82 /usr/local/mysql/bin/mysqld --user=_mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --log-error=/usr/local/mysql/data/mysqld.local.err --pid-file=/usr/local/mysql/data/mysqld.local.pid --keyring-file-data=/usr/local/mysql/keyring/keyring --early-plugin-load=keyring_file=keyring_file.so
1 - Khởi động lại MySQL trong manager-osx và bạn sẽ ổn thôi
Mẹo. Nếu bạn có nhiều quy trình mysql và không biết quy trình nào muốn dừng, bạn cũng có thể dừng TẤT CẢ quy trình MySQL bằng
root 8006 0.0 0.0 408628336 1648 s000 S+ 11:37AM 0:00.00 grep mysql _mysql 362 0.0 0.0 35192992 3396 ?? Ss Sun10PM 0:21.82 /usr/local/mysql/bin/mysqld --user=_mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --log-error=/usr/local/mysql/data/mysqld.local.err --pid-file=/usr/local/mysql/data/mysqld.local.pid --keyring-file-data=/usr/local/mysql/keyring/keyring --early-plugin-load=keyring_file=keyring_file.so2
Nếu sau đó bạn không thể khởi động lại MySQL, bạn cũng có thể thử lệnh này để khởi động trực tiếp máy chủ MySQL của XAMPP
$ sudo /Application/XAMPP/xamppfiles/bin/mysql.server start
Bài viết tiếp tục sau quảng cáo
c. Thay đổi số cổng MySQL
Khi khởi động MySQL của XAMPP, nếu nó báo không thể kết nối với số cổng, thì thay đổi nó thành số mới sẽ giúp
Để thay đổi số cổng, hãy làm theo hướng dẫn bên dưới
Ghi chú. Để thay đổi số cổng trong tệp cấu hình, bạn cần có thể đăng nhập với tư cách người dùng
[Apache] Status change detected: running [Apache] Status change detected: stopped [Apache] Error: Apache shutdown unexpectedly. [Apache] This may be due to a blocked port, missing dependencies, [Apache] improper privileges, a crash, or a shutdown by another method. [Apache] Press the Logs button to view error logs and check [Apache] the Windows Event Viewer for more clues [Apache] If you need more help, copy and post this [Apache] entire log window on the forums9 trên macOS của mình. Đây là hướng dẫn [của Apple] về cách thực hiện việc này. https. //hỗ trợ. táo. com/en-us/HT204012