Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

peterlc's avatar

MySQL or MariaDB

Now that Homestead and my hosting supports MariaDB i wonder if you would recommend using MariaDB over MySQL?

0 likes
16 replies
Erulezz's avatar

I switched to MariaDB 10.0 and now 10.1 ~6 months ago and it working perfectly. Because it is an drop-in replacement for MySQL you don't need to configure anything besides installing it. There are a lot of benchmarks available between 10.1 and MySQL 5.7 for example:

https://mariadb.org/maria-10-1-mysql-5-7-commodity-hardware/

Give it a try!

alenn's avatar

So which one is faster, I looked at those benchmarks and it seems that MySql is faster after all.

ohffs's avatar

'Faster' will depend quite a bit on your workload. I largely switched to mariadb about 3yrs ago and for my cases it's generally been as fast or faster then stock mysql, but with lower memory use and has also been more consistent in the query times. But ymmv - give it a try :-)

peterlc's avatar

As an old Joomla guy i am overwhelmed by the speed of Laravel so this is not an "i need more speed" thing.

Is there any pros besides speed or is this the only reason to move from MySQL?

ohffs's avatar

Depends on your feelings about the way Oracle controls & licenses mysql really (or your feelings about Oracle in general). Although ontop of that most of the main linux distro's have shifted to mariadb as the default (I think Debian/Ubuntu is the only one still shipping mysql as the default) too.

peterlc's avatar

As long there is no big cons i think i will go with the flow and jump into MariaDB.

jekinney's avatar

As the makers of MySQL make Maria and from my experience it's the same thing from a user perspective. Speed wise it looks like generally less then a ms difference.

As mentioned MySQL isn't truly open source where Maria is. Right now other then that one really doesn't stand out from the other imo. So changing an app to Maria doesn't seem feasible where starting something new might be.

shez1983's avatar

I am not sure.. the makers of MYSQL give it away to sun who give it to Oracle (or get merged).. then the owner of MySQL create MariaDB?... why did they give away MySQL in the first place?

ohffs's avatar

@shez1983 it's been a few years, but my memory is that the creator of mysql (Monty) sold the company to SUN (as far as I remember with an explicit clause that it should never be sold to Oracle). Then Oracle bought the whole of SUN including mysql - and so bypassed the clause as they were buying SUN, not MySQL directly. At least that's my probably dodgy memory of how things went ;-)

peterlc's avatar

the Laravel/Homestead docs says i just have to add mariadb: true in my yaml file but i still get mysql, what am i doing wrong?

bashy's avatar

@peterlc You provisioning afterwards? Have you updated the git repo (cd ~/Homestead && git pull)

peterlc's avatar

wasn't sure on how to update Homestead so i did compose update.

did an git pull and: 27 files changed, 259 insertions(+), 674 deletions(-)

did i just update Homestead ? :)

peterlc's avatar

Still MySQL after destroy/vagrant up/provision

I had to do this to get MariaDB:

Remove mysql server

sudo DEBIAN_FRONTEND=noninteractive apt-get --yes remove --purge mysql-server mysql-client mysql-common mysql-community-server mysql-community-client sudo apt-get --yes autoremove sudo rm -rf /var/lib/mysql sudo apt-get autoclean

install mariadb server 10.1

sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db sudo add-apt-repository --yes 'deb [arch=amd64,i386] http://mirror.zol.co.zw/mariadb/repo/10.1/ubuntu trusty main' sudo apt-get update -q sudo debconf-set-selections <<< 'mariadb-server-10.1 mysql-server/root_password password secret' sudo debconf-set-selections <<< 'mariadb-server-10.1 mysql-server/root_password_again password secret' sudo DEBIAN_FRONTEND=noninteractive apt-get install -y mariadb-server

Please or to participate in this conversation.