0

After changing the main site URL from IP address to a domain name (the "Site Address" field), it shows the following error when accessing "Network Admin" page:

Error establishing a database connection

It is important to note that the site is accessible via its new URL, however "Network Admin" and all the multisite settings are not.

6
  • how did you change it? Did you do an SQL query to change it? If so, is the IP address the same number of characters as your domain name? Or different? If it's different then you've corrupted a lot of PHP serialised data structures. Otherwise, migrating a sites URL is a bit more involved than just changing it in the settings
    – Tom J Nowell
    Commented Nov 12, 2021 at 23:28
  • I assume additional changes needed to be made in the DB, but I am not sure how to do that
    – Windows
    Commented Nov 13, 2021 at 11:35
  • yes, you're trying to perform a standard site migration, any site migration article or tutorial applies here, narrowing your search to be specific to the root multisite blog is unnecessary and does not help your cause. Look up any standard well regarded article on how to migrate a sites URL, there are no special multisite steps
    – Tom J Nowell
    Commented Nov 13, 2021 at 14:22
  • I don’t think I fully understand your answer. A site migration is required? where do I move the site to?
    – Windows
    Commented Nov 15, 2021 at 19:03
  • a site URL migration, aka changing olddomain.com to newdomain.com, there is a process necessary to do this that you have not done, it's not enough to change the site url, you have to change all URLs across the entire database using a tool that can deserialise, update, then re-serialise the PHP values that will be broken by a naive update query
    – Tom J Nowell
    Commented Nov 15, 2021 at 23:24

1 Answer 1

0

Probably this due to the siteurl setting in db. But for multisite, how did you configure for mult

UPDATE wp_options SET option_value='YOUR_SITE_URL' WHERE option_name='siteurl'
3
  • Something is wrong, mariadb prompts "->" after running this command.
    – Windows
    Commented Nov 13, 2021 at 10:21
  • got it to run but 0 rows affected.
    – Windows
    Commented Nov 13, 2021 at 10:27
  • SQL update string replace queries will corrupt and break any serialised PHP values if the length changes, it's not enough to change the siteurl. Also this query will only work for single sites, and doesn't account for multisites
    – Tom J Nowell
    Commented Nov 13, 2021 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.