The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL Profiles: user app migration to using remote server

Discussion in 'Database Discussions' started by Souther, Jun 21, 2017.

  1. Souther

    Souther Registered

    Joined:
    Jun 21, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,204
    Likes Received:
    1,297
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  3. Souther

    Souther Registered

    Joined:
    Jun 21, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,204
    Likes Received:
    1,297
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  5. Souther

    Souther Registered

    Joined:
    Jun 21, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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...
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,204
    Likes Received:
    1,297
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

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

    Thank you.
     
  7. Souther

    Souther Registered

    Joined:
    Jun 21, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    San Jose, CA
    cPanel Access Level:
    Root Administrator
    Your Support Request ID is: 8635897
     
Loading...

Share This Page