Replacing MySQL with MariaDB in a CentOS VPS

Status
Not open for further replies.

NewEraCracker

Active Member
1,335
2010
203
10
Hello,

MariaDB is a database server that offers drop-in replacement functionality for MySQL. MariaDB is built by some of the original authors of MySQL, with assistance from the broader community of Free and open source software developers. In addition to the core functionality of MySQL, MariaDB offers a rich set of feature enhancements including alternate storage engines, server optimizations, and patches.

Before installation you can wget its packages from a mirror:
1. Go to their download page: http://downloads.askmonty.org/mariadb/
2. Select the version you wish to use (personally I like the new 5.3 series given the improvements it has)
3. Select the linux package in the checkbox and it should give you some options
4. In my case, since my CentOS install is i386 I've clicked in "CentOS 5 x86 RPMs"
5. Browse the mirror rpms and wget each of them in the server. I recommend creating a new directory for the packages to be downloaded into.
Code:
mkdir mariadb
cd mariadb
wget package-url

Now you can follow the instructions here:
kb.askmonty.org/en/installing-mariadb-rpm-files
kb.askmonty.org/en/how-can-i-upgrade-from-mysql-to-mariadb

Possible issues and fixes:
I had it complaining about missing Perl(DBI) running "yum install perl-DBI" (without quotes) in ssh installs that dependency.
Since you had to remove mysql from your server, you may have also removed php-mysql package. To reinstall it "yum install php-mysql" (without quotes) and then restart apache.

Tuning MariaDB:
Create or edit the my.cnf file at /var/lib/mysql/

Add add this:
Code:
[mysqld]
default-storage-engine=myisam
ignore-builtin-innodb
Setting default storage engine back to myisam is useful if you, for some reason, want to go back to MySQL.
Disabling innodb would reduce RAM usage if you don't need it.

Issues with Webmin and how to fix:
MySQL Database Server > Module Config
Code:
Command to start MySQL server: /etc/init.d/mysql start
Command to stop MySQL server: /etc/init.d/mysql stop
MySQL configuration file: /var/lib/mysql/my.cnf

Should you require any help, reply to this thread and I (or someone) will help you :)

PS: Don't forget to restart mysql after changing configuration :)
 
Last edited:
14 comments
This is the my.cnf file I use in my server, hope you find it useful:

Code:
[mariadb]
default-storage-engine=myisam
ignore-builtin-innodb
optimizer_switch='derived_merge=off,materialization=off'
pbxt=off

[mysqld]
bind-address = 127.0.0.1
port	= 3306
key_buffer_size = 32M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
net_buffer_length = 16K
read_buffer_size = 512K
read_rnd_buffer_size = 1M
myisam_sort_buffer_size = 16M
thread_cache_size = 4

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
 
Last edited:
Yes MariaDB works just the same as MySql as far as commands are concerned.

I am using it now (locally) and see no improvement in speed but then again I only have one user.
 
Status
Not open for further replies.
Back
Top