Làm cách nào để sửa cổng mysql trong xampp?

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 forums
0 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 forums
1 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 forums
2

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 forums
0 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 forums
1 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 forums
5 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 forums
6 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 forums
1 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

  1. Vấn đề
  2. Nguyên nhân có thể và cách khắc phục
    1. Xung đột máy chủ MySQL
    2. Giết các quy trình MySQL hiện có bằng Terminal
    3. Thay đổi số cổng của MySQL
  3. 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

MySQL không bắt đầu trong XAMPP

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 forums
8 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

không thể kết nối phpMyAdmin mà không khởi động MySQL

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

  1. Chuyển đến Ứng dụng → Tiện ích → Giám sát hoạt động
  2. Chọn tất cả quy trình
  3. Tìm kiếm sql bằng cách sử dụng hộp tìm kiếm
  4. Bạn sẽ thấy quy trình mysqld, nhấp đúp vào quy trình đó và nhấn Quit
  5. Sau khi hoàn tất khởi động lại mysql trong manager-osx và nó sẽ chạy

Xóa các quy trình mysqld hiện có bằng Trình giám sát hoạt động

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 forums
9 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

  1. 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;
  2. 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ó
  3. 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
  1. 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
  2. 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.so
2

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

XAMPP không thể liên kết với cổng 3306

Để 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 forums
9 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

Làm cách nào để giải phóng cổng 3306 cho MySQL XAMPP?

Mở Bảng điều khiển và nhấp vào Bảo mật
Nhấp vào Tường lửa của Windows
Nhấp vào Cài đặt nâng cao, Quy tắc gửi đến
Nhấp vào Quy tắc mới
Nhấp vào Cổng, sau đó nhấp vào Tiếp theo. Chọn TCP. .
Nhấp vào Tiếp theo, sau đó nhấp vào Cho phép kết nối
Kiểm tra tên miền và riêng tư
Nhập MySQL làm Tên và Mô tả

Làm cách nào để định cấu hình cổng MySQL trong XAMPP?

Làm cách nào để thay đổi cổng của máy chủ MySQL trong XAMPP? .
Mở bảng điều khiển xampp
Nhấn Config trên dòng MySQL
mở của tôi. ban đầu
Tìm kiếm biến "cổng" trong "Máy chủ MySQL
Thay đổi cổng thành giá trị mong muốn của bạn
Khởi động MySQL để đảm bảo rằng nó đã thay đổi thành công

Làm cách nào để thay đổi cổng 3306 cho MySQL?

Bước 1 - Dừng dịch vụ MySQL. Đối với CentOS. [root@DBA-Master ~]# dừng dịch vụ mysqld. .
Bước 2 - Thay đổi cổng trong tệp cấu hình MySQL. Đối với CentOS. [root@DBA-Master ~]# vi /etc/my. cnf [mysqld] port= 4545 datadir= /home/ist/mysql lưu và thoát. .
Bước 3 - Khởi động lại dịch vụ MySQL. Đối với CentOS. [root@DBA-Master ~]# dịch vụ mysqld bắt đầu

Chủ Đề