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:
- Login to the remote MySQL server.
-
Create a new user with the same name and with the same password as in
/usr/local/solusvm/includes/solusvm.conf
- Create a SolusVM database backup
- Copy the backup to the server where MySQL is running with the help of rsync, scp or similar tools.
- Create the database with the same name and import the database dump.
# mysql -u username -p database_name < solusvm2019-09-17_08.28.sql
- 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.
Comments
0 commentsPlease sign in to leave a comment.