Internet par surfing karte time. Aap ne Error Establishing a Database Connection ko dekha hoga. Yah ek choti si mistake hoti hai. Aur ish problem ko fix ya solve karna bhi aasan hai. But sahi knowledge nahi hone ke karan. Ish problem ko solve karne ke liye. Hume bahut sari parsaniyo ka samna karna padhta hai. Khas kar Beginner’s ke liye to yah aur bhi jayada challenging ban jata hai. Ish liye hum log ish article un sari bato ko cover karege. Jis ke karan Establishing a Database Error problem hoti hai. Aur janege ki how to fix the error establishing a database connection in WordPress.
WordPress sites mainly two types ke languages par bani hoti hai. Pahla PHP aur dusra MySQL. PHP codes me aap ki site ka pura details store rahta hai. For example themes, plugins, media, text files, documents etc. Aur aap ki sari data website par display hone ke liye. PHP coading ko MySQL database se onnect hona chahiye. Agar ish me jara sa bhi mistake hota hai. To error establishing a database connection ka message display hone lagta hai.
Kis Karan Se Error Establishing A Database Connection Hota Hai?
Jab wordpress database connection ko establish nahi kar pata hai. Tab yah error aane lagta hai. Yah bahut sari karno ki wajah se ho shakta hai. For example database login credentials galat ya change hone ke karan. Ya phir aap ka database server unreachable ya unresponsive hone ke karan. Kabhi kabhi database file curropt hone ke karan bhi yah problem aata hai. But mere hisab se mainly yah problem kuch sort server error bhi ho shakta hai. In sab ke aalawa bhi aur karan ho shakte hai. Karan kuch bhi ho ish problem ko solve kaise kare chaliye jante hai.
Note : Apni site par koe bhi changes karne se pahle. Aap sure jarur ho le ki aap ke pass sufficient backups hai.
How To Fix Error Establishing A Database Connection In WordPress – 3 Easy Tricks
Yaha hum log 3 tarah se Error Establishing A Database Connection ko fix karna janege. To chaliye suru karte hai. Aur jante hai ki. WordPress me Error Establishing A Database Connection kaise fix kare.
1. Fix Error With Database Repair
Sab se pahle aap ko yah dhyan dena hai ki. App ki site ke dono front-end aur back-end (wp-admin)page par. Same error message “Error establishing a database connection” show ho raha hai. For example aap ki home page par. Matlab ki yourdomain.com aur yourdomain.com/wp-admin par same error message show ho raha hai. To aap ko yah step try karne ki jarurat nahi hai.
But aap ke wp-admin page ke upper “One or more database tables are unavailable. The database may need to be repaired” kuch is type ka masaage show ho raha hai. To aap ko apne database ko repair karne ki jarurat hai.
Database ko repair karne ke liye. wp-config.php file me niche diye gaye code ko. ‘That’s all, stop editing! Happy blogging’ line ke upper just add kar dena hai.
define('WP_ALLOW_REPAIR', true);
Note : Wp-config.php file aap ko aap ke hosting ke. Cpanel File manager >> public_html >> domain root >> wp-config.php >> edit me mil jayega.
Upper diye huwe code ko add karne ke baad. App http://www.yoursite.com/wp-admin/maint/repair.php page par ja kar. Setting ko repair kar shakte hai.
Upper diye huwe image me aap dekh pa rahe hoge. Ki database ko repair karne ke liye aap samne do option aa rahe hai. But mai aap ko yahi suggest karuga ki. Aap “Repair and Optimize Database” ko hi select kare. Kyu ki ish option ko select karne par. Aap ko login karne ki bhi koe jarurat nahi hoti hai. Aur aap ki site ki security ke liye bhi yah accha hota hai.
Repair & optimize database finished hote hi. App ne upper diye huwe jo code ko wp-config.php me add kiya tha. Use remove kar de.
Mere hisab se yah process error establishing a database connection ko fix karne me aap ki jarur madad karega. But agar kisi karan ki wajah se yah problem phir bhi fix nahi hota hai. To niche bataye huwe next setp se apni problem ko door kar shakte hai.
2. Checking The WP-Config File
Wp-config.php file WordPress me ek single but most important file hota hai. WordPress installation ke time yah file automatically create ho jata hai. Yah wah file hai jaha wordpress se database ko connect karne ke liye. Us ki puri details specify hoti hai. Agar is file me koi bhi changing hoti hai. To bhi error establishing a database connection ka error aata hai. Aur aap ka blog bhi open hona band ho jata hai.
Aap jab bhi apne wordpress database ka user name aur password change karte hai. To aap ko wp-config file ke setting me bhi use update karna hota hai. Yesa nahi karne ki wajah se bhi aap ki site par error establishing a database connection ka message show hone lagta hai.
define('DB_NAME', 'database-name'); define('DB_USER', 'database-username'); define('DB_PASSWORD', 'database-password'); define('DB_HOST', 'localhost');
App upper diye huwe coading ko dhyan se dekhe. Aur apne wp-config.php ko check kare ki. App ki bhi setting same hai ya nahi.
Yaha ek chiz par dhyan yah dena hai ki. Yah koe jaruri nahi hai DB_HOST Name humesa “localhost” hi ho. Yah aap ki web hosting provider company ke upper depend karta hai. Waise india ke most pouplar hosting company HostGator aur Bluehost ka DB name localhost hi hai.
3. Overloaded Traffic
Yah problem kabhi kabhi Overloaded traffic ki wajah se bhi hota hai. Matlab aap ki site par bahut jayada traffic aane ki wajah se aap ki site down ho jati hai. Yesa ish liye hota hai kyu ki. Aap ne jo shared hosting plans buy kiya hai. Wah aap ki jayada traffic ko handle nahi kar pata hai. Jis ke karan error establishing a database connection ka message show hone lagta hai.
Ish ka dusra karan aap ki web hosting ke web server ka downtime bhi ho shakta hai. Matlab jab aap ki hosting server down ho jati hai. Jab bhi aap ke samne yah problem aati hai. Agar aap apne hosting me multiple wordpress ko sites installed kiya hai. To aap dusre site ko visite kar ke chack kare. Agar same problem aata hai. To ish ka matlab hai ki aap ka server down chal raha hai. Yesi condition me aap apni hosting company se contact kar ke. Apni problem ko fix karwa shakte hai.
Asha karta hu dosto ab aap ko pata chal gaya hoga ki. “WordPress Me Error Establishing A Database Connection Kaise Fix Kare”. But ish ke aalawa bhi. Aap ko koe aur troubleshooting methods ka pata hai. To aap comment box me bata shakte hai. Taki dusro ka bhi bhala ho shake.
Dosto agar aap ko mera yah post pasand aaya hai. To ish se social media par share karna na bhule. Ish tarah ke aur interesting updates keliye. Humare Newsletter ko jarur subscribe kar le.
Post Pasand Aayi Hai To – Please Share This Post On Social Media:
vipul says
bahut achhi jaankari di aapne…kya aap bata skte hai ki aapka template konsa hai ?
Mangal Gupta says
Child theme+genesis framework
Mukesh Gupta says
Very useful post sir thank you
Deepanshu Saxena says
Very Useful guidance found here.
Thanks for our support.
Sandeep says
Good work thanks for sharing