Drop in replacement MySQL 5.1.x MariaDB branch ?

eva2000

Well-Known Member
Aug 14, 2001
346
19
318
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?

What is MariaDB?

MariaDB is a backward compatible, drop-in replacement branch of MySQL® Database Server which includes all major open source storage engines, including the Maria storage engine.

You can find the MariaDB code at Launchpad, and download binaries at Download.

MariaDB is community developed, in collaboration with Monty Program. Our ambition is to make MariaDB the best open and free branch of MySQL Database Server for the enduser, developer and partner communities.
how they build their centos packages http://askmonty.org/wiki/index.php/Building_MariaDB:CentOS
 
Last edited:

kibotec

Registered
Mar 14, 2011
1
0
51
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.
 

NixTree

Well-Known Member
Aug 19, 2010
413
5
143
Gods Own Country
cPanel Access Level
Root Administrator
Twitter

Kent Brockman

Well-Known Member
PartnerNOC
Jan 20, 2008
1,330
74
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator

aykfounder

Well-Known Member
Feb 22, 2004
102
0
166
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.
 

[email protected]

Well-Known Member
May 27, 2009
51
0
56
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
 
Last edited:

aykfounder

Well-Known Member
Feb 22, 2004
102
0
166
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.
 

aww

Well-Known Member
Feb 10, 2005
152
0
166
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
 
Last edited:

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
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
 

aykfounder

Well-Known Member
Feb 22, 2004
102
0
166
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.
 

aww

Well-Known Member
Feb 10, 2005
152
0
166
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.
 

aww

Well-Known Member
Feb 10, 2005
152
0
166
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

PHP Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication.
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.
 

weatherc

Registered
Feb 3, 2013
3
0
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 :)