I want to sync a local database with OpenShift MySQL, but I can't change my.inf
because I don't have root access. Is it possible to get root access on OpenShift?
Asked
Active
Viewed 671 times
0

Alfred Huang
- 17,654
- 32
- 118
- 189

Kunal
- 77
- 12
1 Answers
0
I believe you are interested in my.cnf
. If you ssh into your gear (rhc ssh <yourApp>
) and check the file (~/mysql/conf/my.cnf
), you will see that it's owned by you, the root access is not needed.
However, if you check the beginning of the file, you will see:
# WARNING: Changes to this file will be lost on every restart/upgrade. Configurable values can be set with environment variables through rhc env set...
#
# Ex: rhc env set OPENSHIFT_MYSQL_LOWER_CASE_TABLE_NAMES=1 -a myapp && rhc cartridge restart -c mysql-5.5 -a myapp
#
# Configurable Values:
# lower_case_table_names -> OPENSHIFT_MYSQL_LOWER_CASE_TABLE_NAMES
# default-storage-engine -> OPENSHIFT_MYSQL_DEFAULT_STORAGE_ENGINE
# max_connections -> OPENSHIFT_MYSQL_MAX_CONNECTIONS
# ft_min_word_len -> OPENSHIFT_MYSQL_FT_MIN_WORD_LEN
# ft_max_word_len -> OPENSHIFT_MYSQL_FT_MAX_WORD_LEN
Which should answer your question on what is configurable and how to do it.

Jiri Fiala
- 1,400
- 7
- 10
-
Hi Jiri, you mean I can modify my.cnf with rhc ssh. Is it? And can I add variable "server_id" in config file as configurable values ? – Kunal Jan 19 '16 at 04:58
-
Yes and no. You can edit the file, but as noted in the file itself, the only persisting configuration changes would be those made using environment variables using `rhc env set`. The `server_id` is not among those 5 environment variables listed there. – Jiri Fiala Jan 19 '16 at 09:51
-
I want to replicate local db with openshift mysql. So I have to make changes in the my.cnf. Is there any way to get root access? – Kunal Jan 20 '16 at 07:38
-
I'm afraid that root access to gears is not available. – Jiri Fiala Jan 20 '16 at 11:39