Σφάλμα "Ο διακομιστής MySQL έχει πάει μακριά": Πώς να διορθώσετε το μήνυμα σφάλματος
Το MySQL Error 2006 "MySQL server has gone" εμφανίζεται ξανά και ξανά - ειδικά όταν εισάγετε βάσεις δεδομένων σε MySQL. Υπάρχει μια απλή λύση στο σφάλμα. Μπορείτε να βρείτε μια επισκόπηση όλων των βημάτων εδώ.
Απλά διορθώστε το σφάλμα MySQL 2006 "Ο διακομιστής MySQL έχει φύγει"
Αυτό το σφάλμα MySQL συμβαίνει κατά την εισαγωγή βάσεων δεδομένων που είναι είτε πολύ μεγάλες είτε η σύνδεση είναι πολύ αργή για τη μεταφόρτωση. Για να διορθώσετε το σφάλμα, απλά αλλάξτε δύο μεταβλητές στο αρχείο διαμόρφωσης MySQL.
- Κάτω από το XAMPP στα Windows θα βρείτε το αρχείο ρυθμίσεων στο C: \ xampp \ mysql \ bin \ my.cnf από προεπιλογή
- Εάν αυτό το αρχείο δεν υπάρχει, μπορείτε απλά να χρησιμοποιήσετε το
Κάντε δεξί κλικ> "Νέο"> Δημιουργία "Έγγραφο κειμένου". - Μια άλλη πρακτική συμβουλή θα σας πει πώς να αποθηκεύσετε το αρχείο με μια νέα επέκταση αρχείου (.cnf).
- Στο Linux, αυτό το αρχείο βρίσκεται στο /etc/mysql/my.cnf από προεπιλογή
Σε αυτό το αρχείο εισάγετε τώρα υψηλότερες τιμές για τις ακόλουθες μεταβλητές:
- wait_timeout = 60 Εδώ εισάγετε το επιθυμητό χρονικό όριο σε δευτερόλεπτα - αν είναι ακόμα πολύ χαμηλό, μπορείτε απλά να το αυξήσετε περαιτέρω.
- max_allowed_packet = 100M Αυτή η μεταβλητή καθορίζει το μέγιστο μέγεθος του πακέτου της μεταφόρτωσης.
Τώρα ορίστε την τιμή αυτής της μεταβλητής προς τα πάνω, ώστε να είναι μεγαλύτερη από το μέγεθος αρχείου της βάσης δεδομένων που πρόκειται να εισαχθεί. - Τέλος, κάντε επανεκκίνηση της MySQL - το σφάλμα δεν θα πρέπει να συμβεί πλέον
- Σημαντικό: Σε ζωντανά συστήματα, θα πρέπει να επαναφέρετε τις μεταβλητές μεταβλητές στις προεπιλεγμένες τιμές τους, καθώς αυτές θα μπορούσαν ενδεχομένως να αντιπροσωπεύουν μια τρύπα ασφαλείας για εισβολείς.
Στο επόμενο άρθρο θα σας δείξουμε πώς εισάγονται βάσεις δεδομένων στη MySQL χρησιμοποιώντας το εργαλείο phpMyAdmin.