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.

Correct method of upgrading MariaDB from cPanel 11.46 to 11.48

Discussion in 'Database Discussions' started by Valetia, Jan 28, 2015.

  1. Valetia

    Valetia Well-Known Member

    Joined:
    Jun 20, 2002
    Messages:
    207
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    If a server was previously upgraded to MariaDB 10.0 in cPanel 11.46 using the following guide:

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

    When that server is upgraded to 11.48, the 'MySQL/MariaDB Upgrade' section of WHM will list MariaDB as being 'Blocked'.

    What is the correct method to unblock MariaDB in this particular case, so as to have 11.48 recognize and keep MariaDB up to date?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Per that document:

    You would have to uninstall MariaDB, revert back to MySQL, and then use the supported method of upgrading to MariaDB so that it's managed through cPanel. I suggest opening a feature request if you want an option to convert from an unsupported installation of MariaDB to a supported installation of MariaDB:

    Submit A Feature Request

    Thank you.
     
  3. Valetia

    Valetia Well-Known Member

    Joined:
    Jun 20, 2002
    Messages:
    207
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Many thanks for your response.

    Following your suggestion, we have reverted back to MySQL and are now able to upgrade MariaDB using the cPanel-supported method introduced in 11.48.

    Here is a guide for those who had previously used the unsupported method of converting from MySQL to MariaDB:

    How to Revert from MariaDB (cPanel-unsupported version) back to MySQL (cPanel-supported version)

    1. Run the following commands to back up your existing MariaDB databases and data:

    Code:
    cp -a /var/lib/mysql /var/lib/mysql.mariadb-old
    cp -a /etc/my.cnf /etc/my.cnf.mariadb-old
    2. Run the following command:

    Code:
    cat /var/cpanel/rpm.versions.d/local.versions
    Verify that you currently have the following entries (among others):

    Code:
    target_settings: 
      MySQL50: uninstalled
      MySQL51: uninstalled
      MySQL55: uninstalled
      MySQL56: uninstalled
    3. Run the following commands to re-enable the MySQL RPM targets:

    Code:
    /scripts/update_local_rpm_versions --del target_settings.MySQL50
    /scripts/update_local_rpm_versions --del target_settings.MySQL51
    /scripts/update_local_rpm_versions --del target_settings.MySQL55
    /scripts/update_local_rpm_versions --del target_settings.MySQL56
    4. To confirm that the settings in the /var/cpanel/rpm.versions.d/local.versions file no longer override the cPanel-provided defaults for the RPM target, run the following command again:

    Code:
    cat /var/cpanel/rpm.versions.d/local.versions
    Verify that you no longer see the MySQL entries that you saw in step 2.

    5. Run the following command to remove the MariaDB yum repository file:

    Code:
    rm -rf /etc/yum.repos.d/MariaDB.repo
    6. Run the following command to uninstall MariaDB:

    Code:
    yum remove MariaDB-server MariaDB-client MariaDB-devel MariaDB-common MariaDB-compat
    7. Run the following command to reinstall the MySQL RPMs provided by cPanel:

    Code:
    /scripts/check_cpanel_rpms --fix
    8. Run the following command to restore your my.cnf file:

    Code:
    cp -a /etc/my.cnf.mariadb-old /etc/my.cnf
    9. Run the following command to restart MySQL:

    Code:
    service mysql restart
    10. Run the following command to rebuild EasyApache's PHP to ensure that all PHP modules remain intact:

    Code:
    /scripts/easyapache --build
    11. All done! You are now running the cPanel-supported version of MySQL. You may now log into WHM and use the 'MySQL/MariaDB Upgrade' section to upgrade to the supported version of MariaDB, if desired.
     
    #3 Valetia, Jan 29, 2015
    Last edited: Jan 29, 2015
  4. kwsoft

    kwsoft Registered

    Joined:
    Sep 22, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks Valetia, your steps worked beautifully for me.
     
  5. xlightwaverx

    xlightwaverx Member

    Joined:
    Sep 27, 2014
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Will this work for CloudLinux? It's SQL monitor only supports certain versions of MariaDB and from what the documentation states, they appear to be older.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,808
    Likes Received:
    667
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, Cloud Linux and MySQL Governor support MariaDB.

    Thank you.
     
  7. xlightwaverx

    xlightwaverx Member

    Joined:
    Sep 27, 2014
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    So this process will allow us to switch back to MySQL, so we can install an older version of MariaDB that is supported by MySQL Governor... There is no steps that would allow MySQL Governor to work with the latest stable release of MariaDB 10.0+ without going backwards?
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,808
    Likes Received:
    667
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You do not use the same steps to upgrade or switch to MariaDB if you are using Cloud Linux with MySQL Governor. MySQL/MariaDB are not handled by cPanel/WHM in those cases. You would upgrade or switch to MariaDB using the instructions at:

    http://docs.cloudlinux.com/index.html?installation3.html

    Simply change "mariadb55" to "mariadb101" if you want MariaDB version 10.1.

    Thank you.
     
  9. xlightwaverx

    xlightwaverx Member

    Joined:
    Sep 27, 2014
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I was not using CloudLinux with MySQL Governor, as I wanted to switch from the unsupported MariaDB install to the Cpanel supported one, and then, in turn, install the MySQL Governor the correct way after installing the CloudLinux supported version of MariaDB. I followed these steps to the 'T' and for the most part things went well. All sites failed to load as the mysql DB failed to start after following the instructions. This is the error I received.

    Code:
    root@panel [/usr/local/etc]# service mysql restart
    /usr/bin/my_print_defaults: Can't read dir of '/etc/my.cnf.d' (Errcode: 2)
    Fatal error in defaults handling. Program aborted
    /usr/bin/my_print_defaults: Can't read dir of '/etc/my.cnf.d' (Errcode: 2)
    Fatal error in defaults handling. Program aborted
    ERROR! MySQL server PID file could not be found!
    /usr/bin/my_print_defaults: Can't read dir of '/etc/my.cnf.d' (Errcode: 2)
    Fatal error in defaults handling. Program aborted
    Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/panel.host.com.pid).
    
    I had to manually create a directory named "my.cnf.d" located within "/etc" as somehow the removal of the original MariaDB packages removed the directory. This caused the SQL server to fail to start.

    I ran "service mysql restart" and the sql server managed to start.

    All DB information was incorrect though, as in every Wordpress Site on the server went directly to the "installation mode"

    I quickly ran the MariaDB upgrade from within Cpanel and the issues have been resolved.

    A bit scary method to switch, but it is done nonetheless with no missing data, but a few complaints :)
     
  10. xlightwaverx

    xlightwaverx Member

    Joined:
    Sep 27, 2014
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Also, if you run into the

    Code:
    Warning: mysql_connect(): Headers and client library minor version mismatch.
    I had to deselect the mysql* check marks I had enabled, and reenable them, comfirming each selection, then rebuild.
     
  11. xlightwaverx

    xlightwaverx Member

    Joined:
    Sep 27, 2014
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    The current issue at hand is now the cpanel server says that MySQL is not running and it is reporting version 10.0.20 of MariaDB when mysql -V clearly shows:

    Code:
    root@panel [/etc/my.cnf.d]# mysql -V
    mysql  Ver 15.1 Distrib 10.0.19-MariaDB, for Linux (x86_64) using readline 5.1
    Now I am getting repeated emails about MySQL being down, but it is not down, it is running fine with the MariaDB governor in effect. How do I go about removing the annoying errors of the mismatched versions?

    Thanks
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,808
    Likes Received:
    667
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...
Similar Threads - Correct method upgrading
  1. Datacenter1
    Replies:
    2
    Views:
    130

Share This Page