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.

Drop in replacement MySQL 5.1.x MariaDB branch ?

Discussion in 'Database Discussions' started by eva2000, Feb 2, 2010.

  1. eva2000

    eva2000 Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    322
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Brisbane, Australia
    cPanel Access Level:
    Root Administrator
    Twitter:
    Any ideas if WHM CentOS based servers are okay if MySQL 5.1.x was manually upgraded to MariaDB 5.1.42 branch MariaDB:Download - Askmonty.org ?

    2 What is MariaDB?

    how they build their centos packages http://askmonty.org/wiki/index.php/Building_MariaDB:CentOS
     
    #1 eva2000, Feb 2, 2010
    Last edited: Feb 2, 2010
  2. internetfab

    internetfab Well-Known Member
    PartnerNOC

    Joined:
    Feb 20, 2003
    Messages:
    336
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Gothenburg, Sweden
    cPanel Access Level:
    DataCenter Provider
    As long as you turn off mysql upgrades in whm you should be alright. I haven't tried MariaDB yet but have used the patched releases by Percona on a few of our customer's VPS without any issues.
     
  3. eva2000

    eva2000 Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    322
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Brisbane, Australia
    cPanel Access Level:
    Root Administrator
    Twitter:
  4. kibotec

    kibotec Registered

    Joined:
    Mar 14, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hello Eva2000

    I would realy like to learn the specific steps you did to manually upgraded MySQL 5.0.91 in cPanel to MariaDB 5.2.4 in Cpanel. I would like to set this up on my new VPS which is running CentOS 5.5 with no databases.

    Any help would be appreciated.

    Thank you in advance.
     
  5. NixTree

    NixTree Well-Known Member

    Joined:
    Aug 19, 2010
    Messages:
    386
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gods Own Country
    cPanel Access Level:
    Root Administrator
  6. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
  7. asawyer

    asawyer Registered

    Joined:
    Jan 14, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    All these links are dead from what I can see.

    I also would like to do this, so any help would be appreciated.

    Alan
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
  9. aykfounder

    aykfounder Well-Known Member

    Joined:
    Feb 22, 2004
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    16
    We did quite a bit of testing with this and it is running live right now without any issues using MariaDB instead of MySQL.

    Here is a full step by step how-to that we used without a problem:

    /http://forums.ayksolutions.com/showthread.php?t=671

    I hope it helps.
     
  10. jj@24khost

    jj@24khost Well-Known Member

    Joined:
    May 27, 2009
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
  11. aykfounder

    aykfounder Well-Known Member

    Joined:
    Feb 22, 2004
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    16
    JJ, what do you mean? It should still work. 11.36 won't change anything. That's just Cpanel version.
     
  12. jj@24khost

    jj@24khost Well-Known Member

    Joined:
    May 27, 2009
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    can't upcp afterwards due to they changed to rpm based setup in 11.36 and it checks for the rpm's now and the tricks to stop mysql from trying to upgrade no longer work.

    @aykfounder here is the error log

    An error was detected which prevented updatenow from completing normally.
    Please review the enclosed log for further details

    ----------------------------------------------------------------------------------------------------
    Code:
     
    [20130129.143237] Detected version '11.36.0.2' from version file. 
    [20130129.143237] --force passed on command line. Upgrade will disregard update config settings. 
    [20130129.143237] Target version set to '11.36.0.2' 
    [20130129.143237] Checking license 
    [20130129.143237] License file check complete 
    [20130129.143237] Checking that the RPM DB is OK... 
    [20130129.143237] glibc-2.5-107 
    [20130129.143237] glibc-2.5-107 
    [20130129.143237] OK: RPM DB is responding to queries 
    [20130129.143237] Testing if rpm_is_working RPM is installed 
    [20130129.143237] package rpm_is_working is not installed 
    [20130129.143237] Testing if it's possible to install a simple RPM 
    [20130129.143237] Preparing... ################################################## 
    [20130129.143237] rpm_is_working ################################################## 
    [20130129.143238] Switching to version '11.36.0.2' of updatenow to perform sync. 
    [20130129.143238] All Needed RPMS are installed. 
    [20130129.143238] Staging 11.36.0.2 cpanelsync files prior to updating /usr/local/cpanel 
    [20130129.143238] Staging x3 theme changes 
    [20130129.143238] Retrieving and staging /cpanelsync/11.36.0.2/x3/.cpanelsync.bz2 
    [20130129.143238] Using mirror: 208.100.0.204 
    [20130129.143238] Staging files for x3 
    [20130129.143303] Retrieving and staging /cpanelsync/11.36.0.2/x3/index.html.bz2 
    [20130129.143315] Retrieving and staging /cpanelsync/11.36.0.2/x3mail/.cpanelsync.bz2 
    [20130129.143315] Using mirror: 208.100.0.204 
    [20130129.143315] Staging files for x3mail 
    [20130129.143317] Staging cpanel changes 
    [20130129.143317] Retrieving and staging /cpanelsync/11.36.0.2/binaries/linux-x86_64/.cpanelsync.bz2 
    [20130129.143317] Using mirror: 208.100.0.204 
    [20130129.143317] Retrieving and staging /cpanelsync/11.36.0.2/cpanel/.cpanelsync.bz2 
    [20130129.143317] Staging files for binaries/linux-x86_64 
    [20130129.143335] Staging files for cpanel 
    [20130129.143343] Retrieving and staging /cpanelsync/11.36.0.2/cpanel/Whostmgr/Pkgacct/register_transfer.bz2 
    [20130129.143343] Set permissions on /usr/local/cpanel/Whostmgr/Pkgacct/register_transfer-cpanelsync to 0755 
    [20130129.143412] Retrieving and staging /cpanelsync/11.36.0.2/cpanel/upgrade_in_progress.txt.bz2 
    [20130129.143429] Retrieving and staging /cpanelsync/11.36.0.2/cpanel/whostmgr/docroot/core.bz2 
    [20130129.143557] Staging new RPMS 
    [20130129.143558] Downloading [url]http://httpupdate.cpanel.net/RPM/11.36/centos/5/x86_64/rpm.md5[/url] 
    [20130129.143558] Downloading [url]http://httpupdate.cpanel.net/RPM/11.36/centos/5/x86_64/MySQL55-devel-5.5.29-1.cp1136.x86_64.rpm[/url] 
    [20130129.143558] Downloading [url]http://httpupdate.cpanel.net/RPM/11.36/centos/5/x86_64/MySQL55-client-5.5.29-1.cp1136.x86_64.rpm[/url] 
    [20130129.143600] Downloading [url]http://httpupdate.cpanel.net/RPM/11.36/centos/5/x86_64/MySQL55-server-5.5.29-1.cp1136.x86_64.rpm[/url] 
    [20130129.143605] Downloading [url]http://httpupdate.cpanel.net/RPM/11.36/centos/5/x86_64/MySQL55-test-5.5.29-1.cp1136.x86_64.rpm[/url] 
    [20130129.143606] All files Staged 
    [20130129.143606] Testing if the newly downloaded RPMS can be installed without conflict 
    [20130129.143606] Testing RPM transaction 
    [20130129.143606] error: Failed dependencies: 
    [20130129.143606] libmysqlclient.so.15()(64bit) is needed by (installed) php-mysql-5.1.6-39.el5_8.x86_64 
    [20130129.143606] libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by (installed) php-mysql-5.1.6-39.el5_8.x86_64 
    [20130129.143606] W Exit Code: 4 
    [20130129.143606] ***** FATAL: Test install failed: error: Failed dependencies: 
    [20130129.143606] libmysqlclient.so.15()(64bit) is needed by (installed) php-mysql-5.1.6-39.el5_8.x86_64 
    [20130129.143606] libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by (installed) php-mysql-5.1.6-39.el5_8.x86_64 
    [20130129.143606] The Administrator will be notified to review this output when this script completes 
    [20130129.143606] E Error testing if the RPMs will install: Died at /usr/local/cpanel/Cpanel/RPM/Versions/File.pm line 843. 
    [20130129.143606] E Detected events which require user notification during updatenow. Will send iContact the log
     
    #12 jj@24khost, Jan 29, 2013
    Last edited: Jan 29, 2013
  13. aykfounder

    aykfounder Well-Known Member

    Joined:
    Feb 22, 2004
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    16
    Your problem is with the libmysqlclient.so.15 error. When that happened to us I had to manually compile php with php-mysql option. Check our post for a how-to.

    I just installed mariadb today for a client and ran upcp and easyapache without any issues.
     
  14. aww

    aww Well-Known Member

    Joined:
    Feb 10, 2005
    Messages:
    152
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Was going to try it this weekend.

    But php is probably going to have to be recompiled no matter what because the paths change to the mysql libraries.

    Cpanel's easyapache uses --with-mysql=/usr

    But when you use the mariadb repository the path needs to be --with-mysql=/var/lib

    (mysqli is strangely unaffected, both use --with-mysqli=/usr/bin/mysql_config )

    [size=+1]I wonder if we can just set a softlink to whatever library it's looking for in /usr and point it to /var/lib instead?[/size]
    It looks like the libmysqlclient is in /usr/lib64 via a softlink already. Can that just be changed or will cpanel overwrite it?
    If it can be changed, it would prevent the need to recompile php manually.

    Code:
    /usr/lib64/libmysqlclient_r.so.16 -> libmysqlclient_r.so.16.0.0*
    /usr/lib64/libmysqlclient_r.so -> libmysqlclient_r.so.16.0.0*
    /usr/lib64/libmysqlclient.so.16 -> libmysqlclient.so.16.0.0*
    /usr/lib64/libmysqlclient.so -> libmysqlclient.so.16.0.0*
    
    Why not just change those softlinks to point to /var/lib/ (wherever mariadb puts the libraries)

    mysql updates from cpanel have to be disabled with: touch /etc/mysqlupdisable
    Did that change in 11.36 ? Is it no longer obeyed?
    Is mysql still excluded by default from yum?

    The question is the proper way to uninstall the existing mysql.
    You can do it through yum but also just via rpm -e --nodeps

    ie. either
    Code:
    yum remove mysql-server mysql-client mysql-libs mysql-devel mysql*
    
    or maybe just
    Code:
    rpm -e --nodeps mysql-server mysql-client mysql-libs mysql-devel
    
    which would avoid having to edit the yum.conf

    not sure if this is accurate:
    Code:
    yum remove MySQL-devel-5.1.66-1.cloud.x86_64
    yum remove MySQL-shared-5.1.66-1.cloud.x86_64
    yum remove MySQL-test-5.1.66-1.cloud.x86_64
    yum remove MySQL-server-5.1.66-1.cloud.x86_64
    yum remove MySQL-client-5.1.66-1.cloud.x86_64
    
    You can see what parts of mysql are install via
    Code:
    rpm -qa|grep MySQL
    


    Also note that in a 64bit environment, the mariadb repository is confusingly named, you should use the amd64 Index of /5.5/centos6-amd64 even if you are on Intel 64bit, the x86 is for 32bit



    Note that in a low memory environment, mariadb might be a problem for some.
    It defaults to aria-engine for temporary tables which CANNOT be disabled unless you manually compile it and make it use myisam like real mysql does via --without-aria-tmp-tables

    Aria engine will grab 128mb for it's page cache and 32mb for it's sort buffer by default, which you can lower but will reduce performance.

    They claim aria is up to 50% faster for temporary tables but that's dubious.

    Also note that mariadb performance options are not on by default. When I look at eva2000 benchmarks I have to doubt any of the extra options were turned on, things like key_cache_segments
     
    #14 aww, Jan 30, 2013
    Last edited: Jan 30, 2013
  15. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    There is currently a defect in 11.36 that ignores /etc/mysqlupdisable. To work around this defect, until we get a fix, add the following to /etc/cpupdate.conf:

    MYSQLUP=never

    We have significantly changed how RPMs are managed by cPanel & WHM in 11.36. Please consult our release notes, which will link you to further documentation on the topic: cPanel & WHM 11.36 Release Notes
     
  16. aykfounder

    aykfounder Well-Known Member

    Joined:
    Feb 22, 2004
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    16
    Ken,

    Thanks for the update on this. That's good to know.

    Apparently you can also follow the instructions here: RPM Cookbook.

    So, you would run the following:

    Code:
    /scripts/update_local_rpm_versions --edit target_settings.MySQL50 uninstalled
    /scripts/update_local_rpm_versions --edit target_settings.MySQL51 uninstalled
    /scripts/update_local_rpm_versions --edit target_settings.MySQL55 uninstalled
    
    /scripts/check_cpanel_rpms --fix --targets=MySQL50
    /scripts/check_cpanel_rpms --fix --targets=MySQL51
    /scripts/check_cpanel_rpms --fix --targets=MySQL55
    That will create a new local.versions file that will show those three RPMs as uninstalled and it should not update them further.

    With all that said, I just tested on a fresh install of WHM 11.36 on a VPS and followed the instructions on our forums (without altering the local.versions file), essentially as you would on 11.34 and everything worked fine. I was able to flawlessly install mariadb latest version, have it running, updated CPanel with /scripts/upcp --force on 11.36 and ran EasyApache with Mysql modules enabled. It recompiled without any errors and the test site is loading without issues on dso, fcgi and suphp.
     
  17. aww

    aww Well-Known Member

    Joined:
    Feb 10, 2005
    Messages:
    152
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    So maybe there is a better path to first let cpanel upgrade to 11.36 and then let it's rpm manager uninstall mysql itself?

    I guess instructions will have to be created for future 11.36 users anyway.

    But manual uninstall should work and between the two mysql upgrade disable tricks, it should protect the install for the future.

    I still question the need to recompile php, it seems like a completely wasted step just to change the path to the libraries, just create a softlink instead.
     
  18. aww

    aww Well-Known Member

    Joined:
    Feb 10, 2005
    Messages:
    152
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Okay I finally got mariadb installed and working this morning.

    The libmysqlclient problem is a nightmare. Very hard to fix it in a clean way, rpm mess, yum mess, softlink mess.

    But I found a third, much much better way to solve the problem than messing with those libraries.

    Since you have to recompile php anyway, just switch to the internal mysqlnd library.

    The MySQL Native Driver (mysqlnd) is a 100% compatible modern replacement for the old MySQL Client Library.

    MySQL :: MySQL native driver for PHP - mysqlnd

    MySQL :: MySQL 5.5 Reference Manual :: 22.9.5 MySQL Native Driver (Mysqlnd)

    PHP: Mysqlnd - Manual

    It's supposed to be faster than the old external libraries anyway. Just change the configure settings to this when you build PHP:

    Code:
                --enable-mysqlnd   --with-mysqli=mysqlnd --with-mysql=mysqlnd
    
    You can also use the =shared,mysqlnd option to make it an external library but why bother.

    Note that if you have old users installed on the server from previous mysql versions you might run into a silent fail that will drive you crazy to figure out.

    The problem is that most PHP programs mask the PHP logins so you never see the errors, even in the logs.

    We were getting this on one old user

    We just had to reset the mysql password for just that mysql user. It was stored in the mysql database using an old style hash and the PHP library refused to connect to it.

    It was a super-weird problem because all the other users on the server were running, except that one and we could not see the error because it was masked by the php silent operator ("@") so it never appeared in any logs.
     
  19. weatherc

    weatherc Registered

    Joined:
    Feb 3, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    +1 for this

    Replaced MySQL with MariaDB with success using aykfounder's How-to.
    No need for manual recompling PHP either, using MySQL/MariaDB 5.5.29 and PHP 5.4.11 :)
     
  20. oviliz

    oviliz Member

    Joined:
    Feb 23, 2013
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page