WordPress Problem, Need Help!

3 replies
My hosting provider change MySQL IP address. I am using cPanel hosting & I have Database backup. But I dont know how to setup new MySQL IP address with WP database. Please Some One Help Me :confused:
#problem #wordpress
  • Profile picture of the author AffluentGifts
    You normally connect to the database by hostname, but that may have changed also. Either way, you can connect by IP:

    Use cPanel File Manager or FTP to download your site's wp-config.php file (it should be in the directory where your Wordpress site is installed)

    Open Computer / My Computer and go to the folder you downloaded the file to.

    Make a backup copy of this file on your computer (use a clear name like BAKwp-config.php so you don't get them confused)

    Edit the original wp-config.php on your computer by Right-clicking and selecting "Open with..." then going to "Choose program", clicking the down arrow to expand and choosing Notepad - uncheck "Always use this program..." and click Open

    look for the line that has

    define('DB_HOST', 'thedatabaseyoupreviouslyconnectedto');

    change thedatabaseyoupreviouslyconnectedto to the full IP address or if possible the hostname that your host provided as your new database location, leaving the single quotes.

    Save the file and upload, overwriting wp-config.php (you did make a backup, right?)

    Reload your site (clear cache first) and it should work.

    Feel free to PM if you're still having trouble.

    Best of luck!

    Peter
    {{ DiscussionBoard.errors[7792146].message }}
    • Profile picture of the author anexplore
      Originally Posted by AffluentGifts View Post

      You normally connect to the database by hostname, but that may have changed also. Either way, you can connect by IP:

      Use cPanel File Manager or FTP to download your site's wp-config.php file (it should be in the directory where your Wordpress site is installed)

      Open Computer / My Computer and go to the folder you downloaded the file to.

      Make a backup copy of this file on your computer (use a clear name like BAKwp-config.php so you don't get them confused)

      Edit the original wp-config.php on your computer by Right-clicking and selecting "Open with..." then going to "Choose program", clicking the down arrow to expand and choosing Notepad - uncheck "Always use this program..." and click Open

      look for the line that has

      define('DB_HOST', 'thedatabaseyoupreviouslyconnectedto');

      change thedatabaseyoupreviouslyconnectedto to the full IP address or if possible the hostname that your host provided as your new database location, leaving the single quotes.

      Save the file and upload, overwriting wp-config.php (you did make a backup, right?)

      Reload your site (clear cache first) and it should work.

      Feel free to PM if you're still having trouble.

      Best of luck!

      Peter
      Thank You so much.
      {{ DiscussionBoard.errors[7797459].message }}
  • Profile picture of the author hostking
    If they changed the port ensure you place the port in aswell:

    define('DB_HOST', 'thedatabaseyoupreviouslyconnectedto:3306');


    as an example
    {{ DiscussionBoard.errors[7792877].message }}

Trending Topics