How to change virtual server to use local DB server when remote server is no longer available?

Operating system: CentOS 7
OS version: Linux 3.10.0-1160.25.1.el7.x86_64 #1 SMP Wed Apr 28 21:49:45 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

– Related to my previous post where I test with a remote MySQL server –
Then I take that server offline. However one site has had its databases hosted on the remote server. No big deal, I have a Virtualmin backup of the site from before when the DBs were moved to the remote.

  • Restoring from backup fails because Virtualmin still tries to restore DBs to the offline remote server.
  • Disabling the MariaDB site feature fails because the remote server is not reachable.
  • Deleting the connection to the remote server (from System Settings -> MariaDB Servers) does not work, because there’s a site that’s using this server.
  • Getting the remote server online is not working because of some dump dump issue with MySQL which is no longer worth the time to get it to work. (upon attempting to move back the DBs to local: mysqldump: Got error: 1045: "Access denied for user 'remote_sql_user'@'this_host_name' (using password: YES)" when trying to connect)

Is there some work around to change the virtual server/site to use the local DB server by force?

Hi,

What do you get if you run:

grep -Ril "remote_sql_user" "/etc"

It happens that the remote_sql_user is the nickname of the Virtualmin server, and is part of the FQDN, so the output you requested might be not what you’d expect.
Do you prefer that I create a unique name and try with it?

Here’s the output:

/etc/passwd
/etc/httpd/conf/httpd.conf
/etc/dovecot/dovecot.conf
/etc/named.conf
/etc/hosts
/etc/logrotate.d/virtualmin.conf
/etc/usermin/authentic-theme/settings.js
/etc/usermin/miniserv.conf
/etc/hostname
/etc/gshadow
/etc/aliases.db
/etc/group
/etc/webmin/bind8/zone-names
/etc/webmin/authentic-theme/settings-[redacted-username].js
/etc/webmin/authentic-theme/settings.js
/etc/webmin/authentic-theme/settings-[redacted-username].js
/etc/webmin/authentic-theme/settings-[redacted-username]
/etc/webmin/webmin.acl
/etc/webmin/mysql-mysql00-[redacted-domain]/config
/etc/webmin/virtual-server/map.dom
/etc/webmin/virtual-server/map.user
/etc/webmin/virtual-server/templates/16113353419761
/etc/webmin/virtual-server/templates/160736970712180
/etc/webmin/virtual-server/domains/161133998248199
/etc/webmin/virtual-server/domains/161469673558326
/etc/webmin/virtual-server/domains/161157621251031
/etc/webmin/virtual-server/domains/161452241322274
/etc/webmin/virtual-server/domains/160737442955070
/etc/webmin/virtual-server/config
/etc/webmin/virtual-server/everyone/161469673558326
/etc/webmin/virtual-server/last-config
/etc/webmin/config
/etc/webmin/mailboxes/config
/etc/webmin/miniserv.conf
/etc/webmin/package-updates/config
/etc/webmin/miniserv.users
/etc/proftpd/ssh_host_ecdsa_key.pub
/etc/proftpd/ssh_host_rsa_key.pub
/etc/shadow
/etc/fail2ban/jail.conf
/etc/awstats/awstats.[redacted-FQDN].conf
/etc/postfix/virtual
/etc/postfix/virtual.db
/etc/postfix/main.cf
/etc/HOSTNAME

I think I found the option in the relevant domains file. Isn’t it mysql_module=?

Yes. In the file at /etc/webmin/virtual-server/domains/* that belongs to the virtual server in question, when the setting set to mysql_module=mysql, the issue is resolved.

Thank you @Ilia! :innocent:

1 Like

What was it set to?

Thank you @Ilia! :innocent:

Not at all! :slight_smile:

Something like:
mysql_module=mysql-host-mydomain-tld

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.