1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Error establishing a database connection

Discussion in 'Web Hosting' started by Fadi946, Jun 5, 2013.

  1. Fadi946

    Fadi946 Power Member

    Joined:
    Mar 25, 2009
    Messages:
    526
    Likes Received:
    77
    Location:
    With my parents :(
    Hello everyone!

    I am trying to put my wordpress (from my localhost) into the hosting! I am going to show you a step by step of what I did, and tell me why it is not connecting to the database!

    1) I went to my localhost, logged it (username root, no password), exported my tvshows database.
    2) Logged in to goDaddy->went to the WebHosting->SQL->Created a Database with the DB name= FadiX, Username = FadiX, Password = FadiY->Imported my tvshows database.
    3) Went to File Manager->Removed all the files that I had inside->Uploaded all of my Wordpress Folder. The folder goes like this TV->Wordpress->All the files here. (See Picture)
    9384d44436d747daf074e8f3c647af51.png
    4) After uploading all of the files, I went to my wp-config.php->edited it, and this is what it looks like:
    4fff73230c65293f577488a36c7ea3c9.png
    (Of course the FadiX and FadiY are not my real username+password+DBname.. just changed it for the example)

    Now when I go to my website, I get a Database error:
    I have been trying to fix it at least 30 hours now! No kidding! This is so frustrating! I made a step by step and tried to be very clear just so someone can be nice enought to help!!

    I would appreciate it SO FREAKING MUCH if someone will find a solution for me!

    Thanks so much!

    -Fadi
     
  2. gergo2007

    gergo2007 Jr. VIP Jr. VIP Premium Member

    Joined:
    Nov 2, 2010
    Messages:
    812
    Likes Received:
    213
    Usually your database name will be something like hostuser_databasename
    So godaddy_FadiX or similar, i'm not sure what it is with godaddy. Check that too!
     
    • Thanks Thanks x 1
  3. Project-Shadow

    Project-Shadow Junior Member

    Joined:
    Mar 9, 2009
    Messages:
    142
    Likes Received:
    159
    GoDaddy usually provides seperate MySQL servers so "localhost" probably is wrong.
    Check your hosting CPanel for your correct MySQL address.

    Alternatively, GoDaddy could be forcing an alternate table name as most mass providers do so you'll find your username or database name is actually godaddy_fadix.

    Let me know how you get on.
     
    • Thanks Thanks x 1
  4. qrazy

    qrazy Senior Member

    Joined:
    Mar 19, 2012
    Messages:
    1,115
    Likes Received:
    1,719
    Location:
    Banana Republic
    You need to replace the DB_HOST with some value(usually an url and not localhost) which you can get it from phpmyadmin where the host will be mentioned. It won't be localhost if it's not a VPS or dedicated server.
     
    • Thanks Thanks x 1
  5. Fadi946

    Fadi946 Power Member

    Joined:
    Mar 25, 2009
    Messages:
    526
    Likes Received:
    77
    Location:
    With my parents :(
    THANKSSSS SOOOOOOO FREAKINGGGGG MUCHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    YOU CAN'T BELIEVE HOW HAPPY I AM RIGHT NOW!! I AM EVEN CAPS LOCKING TO SHOW MY EXCITEMENT!!!

    Yesterday I woke up at 8am and slept at 2am only trying to fix this problem! And today I woke up at 7am and now its 1pm finally managed to solve it!!!!!!!

    Solution: As you guys said, the DB_HOST, I just changed it to what GoDaddy gave me in the details about my DB!

    IF YOU REALLY WANT TO DO SOMETHING, YOU CAN DO IT!! JUST DIG HARD!

    THANKS SO MUCH GUYS AGAIN!! YOU ROCK!!!!!!!


    EDIT:

    I'm sorry guys, can I ask 1 more question?

    So after I fixed it, I got it like website.com/tv/wordpress/stuffhere.php
    I went to the perma link and changed it from website.com/tv/wordpress to website.com and not I get this error:
    No input file specified.
    What do I need to do?

    btw all my helpers!
     
    Last edited: Jun 5, 2013
  6. TheMostCreative

    TheMostCreative BANNED BANNED

    Joined:
    Aug 11, 2010
    Messages:
    49
    Likes Received:
    2
    Were it installed in a sub folder?
    If so you would need to look in the db where is website.com/tv/wordpress and change it to website.com
    just open the sql file in notepad++ and use the search function
     
    • Thanks Thanks x 1
  7. Fadi946

    Fadi946 Power Member

    Joined:
    Mar 25, 2009
    Messages:
    526
    Likes Received:
    77
    Location:
    With my parents :(
    I have opened my sql using Dreamweaver and replaced everything that contains MyWebsite.com/tv/wordpress to "MyWebsite.com/" but it did not work ><

    And yes it is, tv/wordpress are my directories as you could see in my previous images.
     
  8. TheMostCreative

    TheMostCreative BANNED BANNED

    Joined:
    Aug 11, 2010
    Messages:
    49
    Likes Received:
    2
    did you import it again ? Also check your wp-config file.
     
  9. Fadi946

    Fadi946 Power Member

    Joined:
    Mar 25, 2009
    Messages:
    526
    Likes Received:
    77
    Location:
    With my parents :(
    Yes, I imported it again.
    my wp-config file is fine, because I tried importing my old database with the tv/wordpress and it works good.

    Edit: Do I have to play with the permalink thing in the settings?
    Edit: I decided to re-upload everything without my TV/Wordpress files and see if it will work!
     
    Last edited: Jun 5, 2013
  10. TheMostCreative

    TheMostCreative BANNED BANNED

    Joined:
    Aug 11, 2010
    Messages:
    49
    Likes Received:
    2
    If you were on our servers, I would've tried to fix it for you.
    But without have access I can't really do anything.
    Try to check the WP settings and see if there WordPress Address (URL)