How to use a remote MySQL server for SolusVM Master?

Applicable to:

  • SolusVM

Question

How to use a remote MySQL server for SolusVM Master?

Answer

Warning: SolusVM doesn't support remote MySQL connections, use the following workaround at your own risk:

The existing MySQL credentials are required to establish a connection. Find them in the file /usr/local/solusvm/includes/solusvm.conf on SolusVM Master Node. The file contains the string like this:

# cat /usr/local/solusvm/includes/solusvm.conf 
Vmf7LEAnrb5S8x6:218H3lW42EkJZ1y:GOJebeWEl0IOaciXhnM27OryQfQikF:localhost:XFrORvKb69F1QDlmJ6hDqg374iQjL2ndgGIEtkYFTixpFIYFQ0

The string consists of 5 parts divided by `:`, with the following meaning of parts:

CONFIG_TEXT: <DATABASENAME>:<USER>:<PASSWORD>:<HOST>:<the key is the last entry>

Note: a <HOST> variable is localhost by default.

To establish a remote MySQL connection:

  1. Login to the remote MySQL server.
  2. Create a new user with the same name and with the same password as in/usr/local/solusvm/includes/solusvm.conf
  3. Create a SolusVM database backup
  4. Copy the backup to the server where MySQL is running with the help of rsync, scp or similar tools.
  5. Create the database with the same name and import the database dump.

    # mysql -u username -p database_name < solusvm2019-09-17_08.28.sql

  6. Make sure that you can connect to the remote MySQL server from the Master Node via CLI:

    # /usr/bin/mysql --user=USER --password=PASSWORD -h 203.0.113.2 DATABASENAME

    Note: Replace 203.0.113.2 is the actual IP of a remote MySQL server.

Articles in this section

Was this article helpful?
0 out of 0 found this helpful
Share

Comments

0 comments

Please sign in to leave a comment.