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.

Problem with my.cnf

Discussion in 'Database Discussions' started by paszczak000, Dec 25, 2015.

  1. paszczak000

    paszczak000 Active Member

    Joined:
    Nov 29, 2007
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Poland, Łódź
    I have file /root/.my.cnf:

    Code:
    [client]
    user=root
    password=PASS1
    socket=/var/lib/mysql/mysql.sock
    
    [clientbackup]
    user=backup
    password=PASS2
    socket=/var/lib/mysql/mysql.sock
    
    Everything is working fine. I can login into MySQL without password but after few seconds everything stop working. I can see processes:

    Code:
    root      9742  0.3  0.1 103924 21800 ?        S    14:55   0:00 tailwatchd - chkservd - mysql check
    root      9759  0.6  0.1  60184 16968 ?        S    14:55   0:00 /usr/local/cpanel/scripts/restartsrv_mysql
    root      9763  1.4  0.1 109548 26252 ?        S    14:55   0:00 /usr/local/cpanel/scripts/mysqlconnectioncheck
    root      9879  2.2  0.1  57940 16808 ?        S    14:55   0:00 /usr/local/cpanel/scripts/restartsrv_mysql - waiting for lock
    root     10009  0.0  0.0 103300   896 pts/2    S+   14:55   0:00 grep mysql
    
    So I'm thinking that something is wrong with mysqlconnectioncheck. Can you suggest some soluton?
     
  2. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    326
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Are you getting any error while restarting the MySQL service ?
     
  3. cPanelPeter

    cPanelPeter Technical Analyst III
    Staff Member

    Joined:
    Sep 23, 2013
    Messages:
    569
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    The /root/.my.cnf file should only contain your log in credentials.
    [client]
    user=root
    password=PASS1

    All other MySQL configurations (such as socket) should be in /etc/my.cnf

    Please also review the /var/lib/mysql/$HOSTNAME.err log file to see what is happening with MySQL.
     
  4. paszczak000

    paszczak000 Active Member

    Joined:
    Nov 29, 2007
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Poland, Łódź
    There is no error with MySQL. On standard instalation of MySQL everything is wokring fine. Problem is with CPanel setup.

    Your scripts don't like section for example
    [clientbackup].
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,852
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Backup authentication details are not supported if you are manually inputting them into the /root/.my.cnf file. Instead, if your goal is to automatically switch to different remote MySQL server in the event the first one is down, then you could setup a script that replaces the existing information in the /root/.my.cnf file.

    Thank you.
     
  6. paszczak000

    paszczak000 Active Member

    Joined:
    Nov 29, 2007
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Poland, Łódź
    No, the problem is that some scripts in CPanel are reading .my.cnf credentials from wrong sections. Probably mysqlconnectioncheck is using details from [clientbackup] instead of [client] section where is user root.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,852
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    There's no support for custom sections in the /root/.my.cnf file at this time. Could you elaborate on the purpose of the additional section so we can offer an alternative?

    Thank you.
     
  8. paszczak000

    paszczak000 Active Member

    Joined:
    Nov 29, 2007
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Poland, Łódź
    Hi, can you add this support?

    We are using it for our additonal monitoring scripts and backups. We need this sections.
     
  9. paszczak000

    paszczak000 Active Member

    Joined:
    Nov 29, 2007
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Poland, Łódź
    OK, but i don't have there Invite Code.
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,852
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page