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

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

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

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

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

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

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

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

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

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

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

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

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

  • @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!!!!

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

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

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

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

  • @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

  • @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! 👍🏼

  • @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?

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

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

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

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

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

    Thanks first option worked. U r legend

  • @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.

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

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

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

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

  • @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!

  • @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!

  • @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!

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

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

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

    You are soo good, thanks a million times buddie.

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

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

  • @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.

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

    Data base repair works for me!
    Thank you!

  • @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

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

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

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

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

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

    Line 2: @4:34 should be $testConnection

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

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

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

    Great explanation for non-techies 👍

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

    Thanks man, really needed this.

  • @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

  • @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?

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

    You saved my life my man! Thanks

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

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

  • @qlmcoachingsuccessblueprin6119
    @qlmcoachingsuccessblueprin6119 5 лет назад +2

    thanks for your help it did work as you said

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

    Thank you so much 👍

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

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

  • @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?

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

    Great video and troubleshooting tips 👍

  • @GSapStark
    @GSapStark 11 месяцев назад

    what if I can't find the wp-config file in phpmyadmin ? it's nowhere to be found and I can't go forward with troubleshooting :(

  •  4 года назад

    Thanks, worked perfectly for me!!

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

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

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

    Thank you. It was helpful.

  • @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?

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

    Thanks man!!!

  • @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

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

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

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

    The site was doing fine until "Error establishing a database connection" appeared in rare occasion the site could be accessed sometimes not is it the site problem?

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

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

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

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

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

    Thank you that worked for my website

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

    YESSS!! Thank you so much!

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

    非常感谢!爱来自中国

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

    Thanks! config repair works just fine

  • @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

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

    Thanks Man. Best video :)

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

    Worked! Thank you!

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

    Thanks so much for this fixed my issue

  • @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.

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

    Thanks a lot

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

    really great this video. Congrats.

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

    Thank you for this informaion .

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

    This really helped! Thanks

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

    thank you so much

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

    Was so helpful 😭😭

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

    Thanks,worked for me

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

    Someone please help me..I am unable to resolve my error..I have tried everymethod nothing seems to work in my case.

  • @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

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

    Thank u so much repairing worked

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

    good job

  • @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

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

    Hi even after pasting code in wp-config file, this site repair page is not working

  • @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

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

    THANKS

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

    It worked Yay, thanks.

  • @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

  • @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

  • @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 ?

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

    Thanks so much!!

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

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

  • @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?

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

    thank you for the help

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

    The testconnection.php only shows a blank page, nothing else... HELP!

  • @3-dog-solution
    @3-dog-solution 5 лет назад

    Hi chaps, ..
    I still haven't sorted out my localhost XAMPP issue, but a few things have poped up when trying out the above examples.
    Firstly: PHP v5.5.0 scrapped, or depreciated the mysql_connect() function, and it seems that PHP 7 hasn't got the equivalent, .. I call that bullcrap.
    After a lot of precious precocious digging: mainly coming off of the many precocious precious programmers out there, all humming and arring as they are wont do; then I've discovered that mysql (i) can be used instead. Note the [ i ] in the new function, and you can forget all that confusing blurb that goes on about PDO-functions, especially if all you want to do is test the bloomin' thing.
    Also: the example shown in connecting to your database was -- $test Connection, -- when in fact it's $testConnection -- (no space.)
    Here's the code, ..
    Running it tells me that I can connect to my database, but I still can't get XAMPP to load my web-pages.
    Note: not a *new* install, .. it was working fine last night, .. then it wasn't today.
    My journey continues .. hope the above helps.

  • @dasd.bilany
    @dasd.bilany 3 года назад

    It still says error to establishing connection
    for reference exactly what i did
    ___________________________Code Asked to put inside________________________
    (note into php.config)
    define ( 'WP_ALLOW_REPAIR', true );
    after i put the code in i went to the website and did mywebsite/wp-admin/maint/repair.php
    ________________________________________Results_____________________________________
    Same error word per word
    Error establishing a database connection
    __________________________Code i had at very start____________________________
    (Note i did not erase any data only simply added what was told)

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

    Liked & Subscribed. You really saved my ass dude. Thank You

  • @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!!

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

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

  • @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?

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

    How do you do this on a android phone?

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

    After add new database I dont have any option like add a new user ..

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

    The thing is I don't own the site and I don't have those wp-xxx.php files.

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

    Awesome video

  • @PraveenKumar-ts2ok
    @PraveenKumar-ts2ok 5 лет назад

    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 .

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

    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

  • @lgds.gaming8385
    @lgds.gaming8385 Год назад

    where can i find wp directory ?

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

    Thanks Again

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

    Thank you soo000000000000 much--Life saving