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 is missing!

Discussion in 'Database Discussions' started by Jcats, Jul 9, 2015.

  1. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Hello,

    I wanted to see if anyone has run into this recently. Over the past 2 ~ weeks or so, I've had to completely reinstall mysql on about 10 different servers because it just magically disappeared. There is nothing at all out of the ordinary at the time mysql vanished.

    Code:
    150709  6:02:32 [Note] /usr/sbin/mysqld: Normal shutdown
    
    150709  6:02:32 [Note] Event Scheduler: Purging the queue. 0 events
    150709  6:02:32  InnoDB: Starting shutdown...
    150709  6:02:33  InnoDB: Shutdown completed; log sequence number 110126486
    150709  6:02:33 [Note] /usr/sbin/mysqld: Shutdown complete
    
    150709 06:02:33 mysqld_safe mysqld from pid file /var/lib/mysql/vps.domain.com.pid ended
    
    
    root@vps [/]# service mysql status
    mysql: unrecognized service
    
    
    This only started happening since 11.50

    UPCP ran right around that time:

    -rw------- 1 root root 2.1M Jul 9 06:05 update.1436436901.log


    Some related instances in the log show:

    Code:
    [2015-07-09 06:02:30 -0500]       Updating / Removing RPMS.
    [2015-07-09 06:02:31 -0500]   Uninstalling unneeded rpms: MySQL55-test MySQL55-server MySQL55-client MySQL55-shared MySQL55-devel
    
    
    [2015-07-09 06:03:09 -0500]   38% complete
    [2015-07-09 06:03:09 -0500]    - Processing command `/usr/local/cpanel/scripts/purge_old_config_caches`
    [2015-07-09 06:03:09 -0500]    - Processing command `/usr/local/cpanel/scripts/cleansessions`
    [2015-07-09 06:03:09 -0500]    - Processing command `/usr/local/cpanel/scripts/checkbashshell`
    [2015-07-09 06:03:09 -0500]    - Processing command `/usr/local/cpanel/scripts/purge_modsec_log`
    [2015-07-09 06:03:09 -0500]      [14061] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
    
    /usr/local/bin/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
    /usr/local/bin/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
    /usr/local/bin/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
    /usr/local/bin/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
    /usr/local/bin/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
    /usr/local/bin/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
    /usr/local/bin/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
    /usr/local/bin/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
    /usr/local/bin/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
    /usr/local/bin/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
    
    
    I think its clear that cPanel uninstalled an RPM that shouldn't have been? This happened to ~ 10 servers now, anyone else?
     
    #1 Jcats, Jul 9, 2015
    Last edited by a moderator: Jul 9, 2015
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Please post the output from the following commands on a server where this occurred:

    Code:
    grep mysql-version /var/cpanel/cpanel.config
    rpm -qa|grep MySQL
    cat /var/cpanel/rpm.versions.d/local.versions
    Thank you.
     
  3. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    This might not help now because I had installed mariadb using:

    https://documentation.cpanel.net/display/CKB/How+to+Replace+MySQL+with+MariaDB

    to get it back online asap. I couldn't use WHM to upgrade to MariaDB since MYSQL was gone.


    root@vps [/]# grep mysql-version /var/cpanel/cpanel.config
    mysql-version=10.0
    root@vps [/]# rpm -qa|grep MySQL
    cpanel-perl-514-MySQL-Diff-0.43-2.cp1146.x86_64
    compat-MySQL51-shared-5.1.73-1.cp1150.x86_64
    perl-DBD-MySQL-4.013-3.el6.x86_64
    compat-MySQL50-shared-5.0.96-4.cp1136.x86_64
    root@vps [/]# cat /var/cpanel/rpm.versions.d/local.versions
    ---
    file_format:
    version: 2
    install_targets: {}

    rpm_locations: {}

    srpm_sub_packages: {}

    srpm_versions: {}

    target_settings:
    MySQL50: uninstalled
    MySQL51: uninstalled
    MySQL55: uninstalled
    MySQL56: uninstalled
    easy-tomcat7: uninstalled
    url_templates: {}
     
  4. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
  5. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    This just happened again on a dedicated.

    MySQL is gone.

    [Tue Jul 28 10:33:39.280719 2015] [:error] [pid 6700] [client x.x.x.x:53034] /usr/bin/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

    root@server [~]# whereis mysql
    mysql: /usr/lib64/mysql /usr/local/lib/mysql.sock

    I removed mysql* from /etc/yum.conf, used yum to install mysql mysql-server then ran the mariaupgrade in WHM which resolved it, but I don't understand what could possibly be causing this to keep happening to random servers.
     
  6. ModServ

    ModServ Well-Known Member

    Joined:
    Oct 17, 2006
    Messages:
    332
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Egypt
    cPanel Access Level:
    Root Administrator
    After switching to MariaDB, did you perform an EasyApache?
     
  7. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Yes, I had to run

    /scripts/easyapache --build

    as the mariadb upgrade failed at some point even though it did actually install mariadb successfully.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  9. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    We are not. This is still happening by the way, both to VPS and dedicated server installs. I've had to reinstall MySQL on 5 completely different servers within the past 2 days, all new installs.

    I have to go into /etc/yum.conf remove mysql*, then yum -y install mysql mysql-server
    then run the mariadb upgrade twice because it fails the first time.
     
    feldon27 likes this.
  10. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    I am doing one now as we speak:

    root@server [~]# php -v
    php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

    root@server [~]# mysql
    -bash: mysql: command not found
     
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Could you open a support ticket using the link in my signature before resolving the issue next time? Post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
  12. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Ill do a fresh install on a test server only because I cannot have a customer wait for you to resolve it, I am not saying your response times are slow by any means because you guys are awesome anytime we need to open a ticket but every second counts :) Ill open a ticket once the issue comes about which usually occurs after a cPanel update. Thanks!
     
  13. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Ah fail on my part :(

    For the longest time I ran a bash script I created to install csf, configure tweak settings, etc, etc. I just noticed in my cpanel.config:

    mysql-version=10.0

    I am assuming when upcp runs it sees that and is removing the rpm's that are currently installed which are not 10.

    Is there a way we can install MariaDB by default when running the cPanel installer?
     
  14. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, this is possible via the instructions at:

    Installation Guide - Preconfigure cPanel & WHM Configuration Settings

    In particular:

    Thank you.
     
  15. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Yeah that's what I was doing but without thinking I was pulling cpanel.config AFTER cPanel was already installed, dumb mistake on my part which was causing cPanel to uninstall MySQL when upcp was ran. Thanks for the info.
     
  16. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

Share This Page