How To Fix “Error Establishing A Database Connection” In WordPress

Поделиться
HTML-код
  • Опубликовано: 26 апр 2018
  • Learn how to fix “Error Establishing A Database Connection” on your WordPress blog!
    Blog post: www.elegantthemes.com/blog/ti...
    Linked mentioned: www.yourwebsite.com/wp-admin/maint/repair.php
    Like us on Facebook: / elegantthemes
  • ХоббиХобби

Комментарии • 212

  • @LoopcrateAudio
    @LoopcrateAudio 3 года назад +5

    Thank you SOOO MUCH for this! Was freaking out after trying to fix it for hours and this worked like a charm! 👍🏼

  • @jordan17bliss
    @jordan17bliss 5 лет назад +5

    Thanks for the fix! Editing the wp-config.php file was exactly what I had to do. Working great now. Life saver.

    • @nazimbelli937
      @nazimbelli937 3 года назад

      Any help pls, im using vultr vps server and i faced this issue and i cant repair it im confused , should i connect my server with FTP like filezilla or i should enter to that by PUTTY .PLS ANYONE CAN HELP .THANKS IN ADVANCE

  • @guyeeeee
    @guyeeeee 5 лет назад

    Thank you! Had this for 2 days, had to create a new user name as you show and now it works.

  • @patorjk
    @patorjk 5 лет назад +1

    Dude, you are freaking amazing!! I had a user to my site email me about getting this when the search functionality was used. I noticed it also appearing for other spots on my WordPress blog too. I emailed support, but got no response. I figured since it was almost Christmas I'd be SOL. However, after trying your test-connection code, I was able to get an idea of what was wrong and fix the issue. Anyway, thanks for making this video!

  • @JenniferVerdin
    @JenniferVerdin 5 лет назад +1

    Thank you!! Your video helped me fix my issues even tech support from my hosting company couldn't fix :) appreciate it!

  • @robgarza6591
    @robgarza6591 4 года назад

    This video indirectly helped me solve my problem. The issue was with the config.php file. Thanks!

  • @bravesolani1320
    @bravesolani1320 Год назад

    Thanks Bro... First Option didn't work but the second worked instantly.
    Great Tutorial, straight to the point... Sweet.

  • @1gk
    @1gk 3 года назад +1

    Thank you!!! Learning about the wp_options table in the database was a lifesaver for me.

  • @learningsolutionsgroup
    @learningsolutionsgroup Год назад

    Thank you, I was able to repair my database and get my site back online using your tutorial

  • @redirajahdielrosario3645
    @redirajahdielrosario3645 2 года назад

    THANK YOU SO MUCH! IT WORKED! I modifed my SQL database and that error popped up after the update! THANK YOU AGAIN!!!!

  • @muriukified
    @muriukified 4 года назад +1

    This a good brief video to the point. Only thing is PDO connection seems to be the standard now as Mysqli is deprecated in most hosts. Also line2 of test code has a typo: $test Connection should be $testConnection. In my case, everything was set up ok but didn't work. I had to create a new user and assign to the database for WordPress to work. Then I deleted the old user. Always try that before trying to repair the database.

  • @d4gameplay317
    @d4gameplay317 3 года назад +2

    Amazing! I had troubles with this after moving hosts and the repair code (and repairing database) worked perfectly. Thanks so much!

  • @JeffDeWitt
    @JeffDeWitt 4 года назад

    That did it, repairing the wp-config-php file fixed my problem, thanks!

  • @lailaisolutions4305
    @lailaisolutions4305 5 лет назад +1

    WONDERFUL VIDEO!,, THANK YOU, WORKED LIKE A CHARM!..

  • @Ghaleon
    @Ghaleon 4 года назад +2

    I'm trying to run my wordpress in localhost so I can make a few changes and upload again via FTP.
    But when I downloaded the files I'm receiving this error because I don't have that database. How may I get the wordpress database and have it locally?

  • @sheikhhussein6233
    @sheikhhussein6233 3 года назад +1

    Thank you so much buddy... You're a life saver

  • @gustavofarianascimento2959
    @gustavofarianascimento2959 3 года назад

    Data base repair works for me!
    Thank you!

  • @piachitasji5846
    @piachitasji5846 4 года назад +1

    Thank you for this tuto. So I can't connect me to the database. After did every steps, the error still appears :'(
    I made it with WAMP, maybe do you think 'll be different with XAMPP ?
    Thank you so much

  •  4 года назад

    Thanks, worked perfectly for me!!

  • @tomislav_._9224
    @tomislav_._9224 Год назад

    Thank you, this tutorial saved my nerves and brought my site back to life! :)

  • @FemaleTraderRamya
    @FemaleTraderRamya 2 года назад

    Great explanation for non-techies 👍

  • @Qamre_Alam
    @Qamre_Alam 4 года назад

    I am really very grateful to you bro... Heartily thanks from India...

  • @webdesigncfgromania579
    @webdesigncfgromania579 2 года назад

    Hi. I was able to restore the database. Very good information. Thanks!

  • @kamalhines
    @kamalhines Год назад

    OMG thank you so much problem fixed with the first option,,,, you are genius among men.

  • @abenezer3937
    @abenezer3937 4 года назад

    Thanks! config repair works just fine

  • @ghaffarhunzai
    @ghaffarhunzai 6 лет назад

    Dear this is a wonderful tutorial ... keep on your great work ...

  • @qlmcoachingsuccessblueprin6119
    @qlmcoachingsuccessblueprin6119 4 года назад +2

    thanks for your help it did work as you said

  • @jackmthembu3734
    @jackmthembu3734 4 года назад

    This really helped! Thanks

  • @joshuajackson7941
    @joshuajackson7941 4 года назад

    Thanks a lot. U help me a lot!!! I'm a beginner

  • @user-sn3ic6qp6i
    @user-sn3ic6qp6i 3 года назад

    I have just restarted my server and the website works well now!

  • @JamesNdungu1
    @JamesNdungu1 2 года назад

    Mine was a simple WordPress PHP thing repair. Thank you, solved my problem :)

  • @aritora778
    @aritora778 3 года назад

    Thanks a lot. You are a life savior.. and job savior too!

    • @nazimbelli937
      @nazimbelli937 3 года назад

      Any help pls, im using vultr vps server and i faced this issue and i cant repair it im confused , should i connect my server with FTP like filezilla or i should enter to that by PUTTY .PLS ANYONE CAN HELP .THANKS IN ADVANCE

  • @prula
    @prula 3 года назад

    Worked! Thank you!

  • @topuinternationallimited7214
    @topuinternationallimited7214 3 года назад

    Many thanks, when i fix it, i solved the problem, thanks guys

  • @sylvestersmyles-crentsil5758
    @sylvestersmyles-crentsil5758 2 года назад

    Thanks man, really needed this.

  • @farhanahmad5934
    @farhanahmad5934 4 года назад

    Great video and troubleshooting tips 👍

  • @naderabouchakra2638
    @naderabouchakra2638 4 года назад

    Thank you that worked for my website

  • @beautifulpapillon
    @beautifulpapillon 2 года назад

    Thank you. It was helpful.

  • @DutchMermaid
    @DutchMermaid 4 года назад

    Thank you very much for this video - very helpful. Got my site back up ^^ :D

  • @digitaldealsshop
    @digitaldealsshop 4 года назад +2

    Thank you so much! This happened to me today and I followed your instructions and all is good now! Again, thanks! Great video!

    • @marufhossain794
      @marufhossain794 4 года назад

      Hi, i Don undrestand his english, will you help me pls what is actually he done

    • @marufhossain794
      @marufhossain794 4 года назад

      I dont have wp-config file

  • @samuelmwangu9718
    @samuelmwangu9718 4 года назад

    Thanks,worked for me

  • @tapiwanashejamielkazembe2346
    @tapiwanashejamielkazembe2346 9 месяцев назад

    You are soo good, thanks a million times buddie.

  • @Groooovs
    @Groooovs 3 года назад

    You saved my life my man! Thanks

  • @jonthemachine1970
    @jonthemachine1970 4 месяца назад

    2:16 lost me. Thanks for showing us how smart you are.

  • @lucreciafraile5087
    @lucreciafraile5087 4 года назад

    really great this video. Congrats.

  • @SaifZiya
    @SaifZiya 5 лет назад

    I've started getting this error after upgrading my VPS (1 GB) plan to VPS (2 GB) plan. On VPS (1 GB), my website was getting around 500 users at the same time (working fine). But, after switching to VPS (2 GB), it could only handle 2 to 3 hundred users.
    Any idea what the problem is?

  • @spagetka99
    @spagetka99 4 года назад +1

    Thanks god for people like you. You saved my life :D

    • @nazimbelli937
      @nazimbelli937 3 года назад

      Any help pls, im using vultr vps server and i faced this issue and i cant repair it im confused , should i connect my server with FTP like filezilla or i should enter to that by PUTTY .PLS ANYONE CAN HELP .THANKS IN ADVANCE

  • @Toluwase1000
    @Toluwase1000 5 лет назад

    thanks for the help

  • @alextrd7951
    @alextrd7951 4 года назад

    my site is hosted on AWS and i searched the mysql folder via filezila but couldn't find that file which contains database name and other credential. do you have any documentation for AWS or is there any specific name of that file ?

  • @forsterarts
    @forsterarts 3 года назад

    It worked Yay, thanks.

  • @videotodvdscotland
    @videotodvdscotland 2 года назад

    Thanks so much for this fixed my issue

  • @osashills1
    @osashills1 3 года назад

    Thank you for this informaion .

  • @leonkambarami8091
    @leonkambarami8091 2 года назад

    Thanks first option worked. U r legend

  • @chaoSefat
    @chaoSefat 3 года назад +3

    I don't have wp-config.php not even in the zip I downloaded from WordPress.org

  • @karteltech1
    @karteltech1 2 года назад

    This helped me to address my issue.
    i had previously changed my cpanel name and this changed the username of all my databases. so i logged in to my cpanel, root directory of my website and edited the wp config file and put the correct username of my databases. i first checked the username of my databases using the cpanel file manager.

  • @Illimutu
    @Illimutu 5 лет назад

    Thank you

  • @ismetomerkoyuncu1179
    @ismetomerkoyuncu1179 2 года назад

    Thank u so much repairing worked

  • @GovindSharma-el2zs
    @GovindSharma-el2zs 4 года назад

    thank you for the help

  • @ilhanhassan7941
    @ilhanhassan7941 4 года назад

    I have a question if I’m on a website and error establishing data connection it it something on my side or should I just wait for the website to fix itself

  • @vipergx
    @vipergx 5 лет назад

    just in case anyone lost the wp-config file like I did. when recreating it (making sure u have the right credentials for the database inside it) set the correct permissions for it. 0600 in my (and most likely your) case. cheers

  • @CarlosDiazChico
    @CarlosDiazChico 4 года назад

    Hola!!..When I tried to access the ftp file, I got this message:
    Under Construction
    The site you were trying to reach does not currently have a default page. It may be in the process of being upgraded.
    Please help!!

  • @zaselalk
    @zaselalk 5 лет назад

    Thank you :)

  • @JulesIvanCGaray
    @JulesIvanCGaray 2 года назад

    YESSS!! Thank you so much!

  • @user-ky7wv7vm9w
    @user-ky7wv7vm9w 9 месяцев назад

    Thank you so much 👍

  • @philtaylor3098
    @philtaylor3098 6 лет назад +25

    This video makes too many assumptions. In my case I've only just created a DB so it can't be incorrect and there is no corruption because there's nothing in ( no tables ), I've copied and pasted the username and password so I know they're correct and yet wordpress still gives me the message "Error Establishing A Database Connection"

    • @ed101poti
      @ed101poti 5 лет назад

      did you manage to fix it? i'm having this same annoying issue for some time now and can't seem to find an answer. a fresh install and still an error in connecting to the database which is on localhost...

    • @ProGamer-ho7lz
      @ProGamer-ho7lz 4 года назад

      this message annoys me do you know how to stop it and fix

    • @muriukified
      @muriukified 4 года назад

      @@ed101poti Always test with a fresh new user with all privileges

    • @marcchami8851
      @marcchami8851 4 года назад

      Did anyone figure this out? helppp

    • @awfulname7610
      @awfulname7610 4 года назад

      Same issue, anyone found the solution?

  • @mooonlitwhispers
    @mooonlitwhispers 4 года назад

    Thank you soo000000000000 much--Life saving

  • @modz9711
    @modz9711 2 года назад

    Hey thanks for video tips,
    But I have an issue when I go to the phpnyadmin and navigate to the wp-options of the current database
    I'm not able to see the site url instead there's something else.
    What could be the reason for this ?
    Thanks in advance.

  • @bsalgurung
    @bsalgurung 4 года назад

    thank you so much

  • @karlbodmann3589
    @karlbodmann3589 2 года назад

    Thanks so much!!

  • @simersingh9927
    @simersingh9927 4 года назад

    actually i am new to wordpress my database connection is not established via wordpress.org showing some connectivity error and i also not having config.php file its config-sample.php what should i do
    things i have tried making other user to the database and give previliges but same error message is shown
    and with installation of wamp server i got marinedb as well

  • @cinemaofsounds
    @cinemaofsounds Год назад

    I didn't give my new database privileges and the MySQL databases allowed me to do that thank you.

  • @gnovaempirellc8474
    @gnovaempirellc8474 4 года назад

    thank its great

  • @Priscillia-Otukoya
    @Priscillia-Otukoya 2 года назад

    Was so helpful 😭😭

  • @hemantdhiman6179
    @hemantdhiman6179 Год назад

    Thanks man!!!

  • @northernghanaofficial
    @northernghanaofficial 2 года назад

    Thanks a lot

  • @Qamre_Alam
    @Qamre_Alam 4 года назад

    Thanks Again

  • @mhpreach
    @mhpreach Год назад

    What I need to know is what directory the sql file goes in on the server. I’m having to migrate my word press site manually. Due to upload file size limit. What directory contains the SQL file?

  • @godestinations
    @godestinations 4 года назад +1

    Thanks Man. Best video :)

  • @Ax4k
    @Ax4k 2 года назад

    I get big traffic spike, I get this error, but server was up. so what should I do in this case?
    it comes for some time, then the site working.
    you give solution for 1 and 2. What about 3?

  • @nikolaikong380
    @nikolaikong380 Год назад

    非常感谢!爱来自中国

  • @helmantmc389
    @helmantmc389 6 лет назад

    Please make a video about how to set meta description in category layout homepage in Extra. This is a big problem for a lot of people.

  • @helenmendoza5956
    @helenmendoza5956 2 года назад

    can i just say you are the best?!!!!!

  • @skalo1840
    @skalo1840 3 года назад

    i really dont know what my host is cause i dont know anything about this,but is this just for website owners btw i have the same problem

  • @chrismacisaac5994
    @chrismacisaac5994 5 лет назад

    I get this when I hit localhost/mywbsite before im even able to install my wp site.

  • @cadekahie8262
    @cadekahie8262 3 года назад

    THANKS

  • @AmirMahmood
    @AmirMahmood 3 года назад

    Thanks bro

  • @PraveenKumar-ts2ok
    @PraveenKumar-ts2ok 4 года назад

    how to access wp-config.php file? I am not even able to login into admin. and FTP. it gave me an error "Unable to read the indexed puredb file (or old format detected) - Try pure-pw mkdb" not even to able login wp-admin. it showing the same error esablishing a database connection error to me. i am using goggie host provider hosting account they haven't given me any answer. can you help me .

  • @S.E.Locksmith
    @S.E.Locksmith 4 года назад

    Awesome video

  • @nanicheri
    @nanicheri 4 года назад

    thx for this it worked I solved my problem

    • @elegantthemes
      @elegantthemes  4 года назад

      That's great Nani! You're welcome! 😄

  • @nj5195
    @nj5195 3 года назад

    A few days ago i click on ''empty'' on wp_option in phpmyadmin.. Now i don't have siteurl and home in phpmyadmin. I checked everything and try with wp allow repair, but when I remove this code, again is the same ''Error Establishing A Database Connection'' I try to add a new user, and update wp-config, still the same. I make this testconenction.php and when i start it says: Connection successfully. Debug log is ''mysqli_real_connect(): (28000/1045): Access denied for user '****''localhost' (using password: YES) in /home//wp-includes/wp-db.php on line 1635

  • @jordanrollicks1289
    @jordanrollicks1289 4 года назад +1

    I didn't understand where to create a new file, help me plz

  • @emsa8090
    @emsa8090 3 года назад

    how can I fix it when i'm trying to get on the website through my phone and it shows the error?

  • @saajidhnawwar8505
    @saajidhnawwar8505 3 года назад

    theres no file called wp-config.php instead only wp-config-sample.php is available. where can i find it?

  • @EmileJobity
    @EmileJobity 4 года назад +2

    Line 2: @4:34 should be $testConnection

  • @tanusreebanik1993
    @tanusreebanik1993 3 года назад

    Can anyone tell me how do I get this php my admin panel?

  • @Techbox1985
    @Techbox1985 4 года назад

    okay and what if nothing of this 3 fixes helps? sql server are the same as webserver (other programs has access) the username and passwords are right (used copy paste! and trible checked this) corrupted database? how the table WP_database is empty ! so now how to fix? the maria-db_error.log has no rejection request errors logged. :s

  • @ProGamer-ho7lz
    @ProGamer-ho7lz 4 года назад

    thank you so sososososo much dude

    • @ProGamer-ho7lz
      @ProGamer-ho7lz 4 года назад

      the code: define( 'WP_ALLOW_REPAIR', true);

  • @azizpalsingh8644
    @azizpalsingh8644 3 года назад

    Thanks, respect++

  • @rachidbouklachi1467
    @rachidbouklachi1467 4 года назад

    thnks :)

  • @yourdailyfails1
    @yourdailyfails1 4 года назад

    i deleted my mysql database of wordpress how can i remove it. or recreate database