Wordpress: Eroare la stabilirea unei conexiuni la baza de date - puteți face asta
Nu vă faceți griji: dacă primiți brusc mesajul „Eroare la stabilirea unei conexiuni la baza de date” la deschiderea site-ului dvs. WordPress, nu trebuie să vă configurați din nou site-ul. Eroarea poate fi remediată ușor cu puține cunoștințe de fundal. Puteți afla cum să faceți acest lucru aici.
Conexiune la baza de date WordPress: serverul bazei de date a eșuat
WordPress necesită o bază de date SQL pentru a funcționa fără probleme în fundal. Dacă conexiunea nu poate fi stabilită, veți vedea un mesaj de eroare în loc de site-ul dvs. Web.
- Uneori, există probleme tehnice pe termen scurt asupra cărora nu ai control.
- Prin urmare, verificați mai întâi dacă serverul de baze de date al gazdei dvs. rulează deloc.
- Puteți apela linia directă sau verificați dacă furnizorul dvs. publică rapoarte de eroare online.
- Dacă puteți exclude că serverul este dezactivat, trebuie să verificați informațiile de conectare de la WordPress la baza de date.
Conexiune la baza de date WordPress: intrările în wp-config sunt incorecte
- Selectați-vă pe serverul dvs. folosind un program FTP și încărcați fișierul "wp-config.php" din directorul rădăcină pe computer.
- Deschideți fișierul cu Notepad sau WordPad.
- Comparați următoarele intrări cu informațiile pe care le-ați primit de la furnizor și cu datele personale de conectare.
- define ('DB_NAME', 'Numele bazei de date');
- define ('DB_USER', 'numele de utilizator al bazei de date');
- define ('DB_PASSWORD', 'parola bazei de date');
- define ('DB_HOST', 'Adresa serverului atribuită de furnizorul dvs.');
- Dacă intrările nu se potrivesc cu datele dvs., corectați-le. Astfel de erori apar adesea în timpul unei noi instalări WordPress sau când schimbați parola site-ului dvs. web existent. Salvați modificările.
- Reveniți la programul FTP și redenumiți „wp-config.php” în „wp-config.php_old”. Deci, aveți întotdeauna o copie de rezervă disponibilă în cazul în care ceva nu merge corect cu modificarea.
- Transferați fișierul corectat pe server. WordPress ar trebui să se poată conecta cu ușurință la baza de date.
- Dacă totul funcționează, puteți șterge backup-ul "wp-config.php_old".
Conexiune la baza de date WordPress: baza de date este deteriorată
- Uneori, o conexiune poate scădea în timp ce datele sunt scrise. O parte din baza de date este deteriorată.
- Furnizorii furnizează de obicei instrumentul "phpMyAdmin". Conectați-vă acolo. Puteți apoi să selectați toate tabelele din baza de date și să le reparați folosind opțiunea „Repararea tabelului”.
- O soluție inteligentă este repararea automată a meselor.
- Știți deja cum să apelați și să modificați fișierul "wp-config.php". Urmați pașii descriși mai sus.
- Introduceți următoarea linie în acest fișier: define ('WP_ALLOW_REPAIR', adevărat);
- De acum înainte, WordPress va repara automat tabelele pentru dvs. și nu mai trebuie să vă faceți griji pentru ele.
Conexiune la baza de date WordPress: baza de date este goală sau nu există
- Această problemă apare mai ales dacă schimbi furnizorul și vechea bază de date nu a fost încă importată corect.
- Conectați-vă la „phpMyAdmin” și verificați dacă baza de date este disponibilă și are conținut.
- Dacă baza de date nu există sau este goală, importați din nou datele din backup.
În articolul următor, citiți exact ce se află în spatele permalinkurilor WordPress.