MySQL Profiles: user app migration to using remote server

Souther

Registered
Jun 21, 2017
4
0
1
San Jose, CA
cPanel Access Level
Root Administrator
I have managed to successfully setup a new MySQL profile for a dedicated MariaDB 10.x server which I have running nearby my main WHM/cPanel server. I activated the new profile and all system database usage switched over to the new server with few issues.

However, user web apps (PHP) running on the main server which reference 'localhost' for database access are still hitting the main server instead of the server associated with the MySQL Profile. I have tried forcing these to use the server's hostname instead of 'localhost' as the hostname, and all this did was break access with the database.

What am I missing?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
Hello,

Could you let us know the contents of your /root/.my.cnf (excluding the actual password and remote host) file and your /etc/my.cnf file?

Thank you.
 

Souther

Registered
Jun 21, 2017
4
0
1
San Jose, CA
cPanel Access Level
Root Administrator
/root/.my.cnf on cPanel server
Code:
[client]
user=root
password=****
port=3306
host=******
/etc/my.cnf on cPanel server
Code:
[mysqld]
innodb_file_per_table=1
default-storage-engine=InnoDB
performance-schema=0
max_allowed_packet=268435456
query_cache_type=1
thread_cache_size=4
innodb_buffer_pool_size=8G
innodb_log_file_size=2G
innodb_buffer_pool_instances=8
innodb_log_buffer_size=4G
read_rnd_buffer_size=256K
sort_buffer_size=2M
query_cache_size=4M
query_cache_limit=1M
max_connections = 500
tmp_table_size = 12M
max_heap_table_size = 12M
join_buffer_size = 512K
general_log = 0
slow-query-log = 1
slow-query-log-file = /var/log/mysql-slow.log
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
Hello,

I don't see anything in those files that suggest an issue with the remote MySQL profile's configuration. Could you also let us know the contents of the /etc/hosts file on your system (ensuring to remove actual domain names and IP addresses)?

Thanks.
 

Souther

Registered
Jun 21, 2017
4
0
1
San Jose, CA
cPanel Access Level
Root Administrator
/etc/hosts on cPanel server

Code:
127.0.0.1               localhost localhost.localdomain localhost4 localhost4.localdomain4
::1             localhost localhost.localdomain localhost6 localhost6.localdomain6
xxx.xxx.xxx.114          thishostname.host.com thishostname
no entry for server referenced in MySQL profile...
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
Hello,

Could you open a support ticket using the link in my signature so we can take a closer look?

Thank you.