• Resolved mhegarty1588

    (@mhegarty1588)


    Okay so I accidentally changed my URL in my wordpress site and the site got all messed up. The homepage was there but the CSS was not there and nothing else was there besides the homepage. Then I went to log in to my phpmyadmin but could not remember the password so I reset it then when I logged into it I went to the databases to switch the values of the URL but the value was no different from the original but it did not get fixed it got worse. Now when I type in my URL it says Error establishing a database connection. Please help me figure this out. I’m freaking out that the site is no longer up running.

    Thank you!

Viewing 15 replies - 1 through 15 (of 16 total)
  • The Barefoot Bookworm

    (@the-barefoot-bookworm)

    Do you have FTP access? See if you can go to Wp-config.php and correct any incorrect settings there.

    Edit: Does this thread help? https://www.ads-software.com/support/topic/error-establishing-a-database-connection-171?replies=20

    Thread Starter mhegarty1588

    (@mhegarty1588)

    I don’t think so. I am very new to this but messed up big time, I think. I was trying to change the site URL and then it got messed up so I logged into phpmyadmin and now it says error establishing a databse connection. I don’t know what FTP access is nor if I have it. I’m sorry for my lack of knowledge.

    The Barefoot Bookworm

    (@the-barefoot-bookworm)

    I found a better thread, updated my comment. This one was also made by someone who changed their site URL.

    FTP is File Transfer Protocol and it bypasses your WordPress dashboard, so you can access your site or hosting account’s file structure without signing into your host’s cPanel. If you don’t have FTP access but you do know your hosting account user and password, you can sign into that. Most of these hosts have a file manager, which works similarly. You can use it to browse to your WordPress directory and find the file wp-config.php — you’ll need a text editor to open it.

    The Barefoot Bookworm

    (@the-barefoot-bookworm)

    And it’s okay, don’t be too hard on yourself. Mistakes are part of the learning process. Remember, your content is (should be) safe. It’s just that your database is having trouble linking to your site. So your work isn’t lost and should be recoverable.

    The Barefoot Bookworm

    (@the-barefoot-bookworm)

    I suspect since you reset the password, those settings got messed up in the WP-config.php file so you will have to manually correct them.

    Thread Starter mhegarty1588

    (@mhegarty1588)

    Thank you so much for answering! I’m pretty new to this and tried to get ahead of myself and now have to quickly dig myself out of this whole. ‘m trying to find the WP-config.php but am having a hard time locating it, would it be in phpmyadmin somewhere?

    The Barefoot Bookworm

    (@the-barefoot-bookworm)

    In wp-config, these are the 4 credentials you need to check:

    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define( 'DB_NAME', 'database_name_here' );
    
    /** MySQL database username */
    define( 'DB_USER', 'username_here' );
    
    /** MySQL database password */
    define( 'DB_PASSWORD', 'password_here' );
    
    /** MySQL hostname */
    define( 'DB_HOST', 'localhost' );

    IF they are all correct, THEN you can add this code to the bottom of the file:
    define( 'WP_ALLOW_REPAIR', true );
    and go to
    yoursite.com/wp-admin/maint/repair.php and let WP attempt to repair your database for you.
    (Whether or not this fixes your problem, remember to delete this line from your wp-config afterwards since anybody could use this maliciously.)

    Thread Starter mhegarty1588

    (@mhegarty1588)

    How do I get to the wp-config though? I’m unsure where to even find the wp-config. If I put it on the end of my website it still says Error establishing a database connection. Sorry for being so “dumb” at this

    The Barefoot Bookworm

    (@the-barefoot-bookworm)

    No, PHPMyAdmin is an interface for your database and as you already know, really bad things can happen there! It’s best not to touch that. Once you sign into your hosting account (I am assuming you don’t have FTP access, otherwise you would have known) then look for the link/button/app that says “File Manager”. This will let you browse through the files on your server. Here, you’ll need to find your WordPress directory. It will be in in the folder public_html or in a subfolder of that.

    (Sorry, page updates only after I post a reply, unless I do it manually, so I missed your question earlier.)

    Thread Starter mhegarty1588

    (@mhegarty1588)

    When I log into phpmyadmin it provides me with links to click to for “Show MySQL system”, “variables Documentation”
    “Processes Documentation”
    “Character Sets and Collations”
    “Databases”
    “Export”
    “Import”

    Which one do I go into?

    The Barefoot Bookworm

    (@the-barefoot-bookworm)

    You don’t go to any of them. Log out of PHPmyadmin and use the File Manager. Which web host are you using? I might be able to find a screenshot of their cPanel to illustrate.

    Thread Starter mhegarty1588

    (@mhegarty1588)

    Godaddy

    Thread Starter mhegarty1588

    (@mhegarty1588)

    Ohh I found the File Manager. Now i am in wp-config

    Thread Starter mhegarty1588

    (@mhegarty1588)

    ITS BACK!! Thank you so much The Barefoot Bookworm!!! I owe you big time! If you really are a bookworm, let me buy you one for helping. You do not know how much this means to me!

    The Barefoot Bookworm

    (@the-barefoot-bookworm)

    Haha! I’m glad it’s fixed. ?? Yes, I really am a bookworm but you don’t need to buy me anything–I like helping, and that’s just how the WP community works. A lot of people helped me out too so I’m really just paying it forward. ??

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘I messed up my website URL and now it says Error establishing a database connect’ is closed to new replies.