MariaDB-5.5.32 source code to compile and install

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

MariaDB database management system is a branch of MySQL, mainly by the open source community in maintaining, using GPL license. One of the reasons for the development of this branch is: Oracle bought MySQL, a potential risk for the MySQL closed source, therefore the community by a branch to avoid this risk.

The purpose of the MariaDB is fully compatible with MySQL, including API and command line, which can easily become the substitute for MySQL. In the storage engine, use XtraDB instead of MySQL InnoDB.

MariaDB by MySQL founder Michael Widenius is leading the development, he had earlier for 00000000, the company he founded MySQL AB sold to SUN, then, with SUN was acquired by Oracle, the ownership of the MySQL also fell into the hands of Oracle. MariaDB name from the Michael Widenius's daughter Maria name.

In 2008, Sun acquired MySQL in 2010, then Oracle also bought Sun, MySQL in the Oracle. The relationship between Oracle and the open source community has not been very good, will MySQL into the community edition and enterprise edition, is not free for commercial use. The new function of MySQL Enterprise Edition is not open source code, so that the user is not. MariaDB does not have this problem.

It is necessary to switch from the MySQL to the MariaDB instance:

  1. Red Hat Enterprise Edition RHEL 7 may use MariaDB instead of MySQL, once RHEL switching, RHEL Community Edition CentOS will be followed to make changes based on
  2. Fedora also plans in Fedora 19 to MariaDB instead of MySQL
  3. Wikipedia has substituted for MySQL using MariaDB

Compared with MySQL, MariaDB has the advantage:

MariaDB will be added to the "LNMP install package

cd /root/lnmp/source
wget -c http://ftp.osuosl.org/pub/mariadb/mariadb-5.5.32/kvm-tarbake-jaunty-x86/mariadb-5.5.32.tar.gz
useradd -M -s /sbin/nologin mysql
mkdir -p /data/mariadb;chown mysql.mysql -R /data/mariadb
tar xzf cmake-2.8.11.2.tar.gz
cd cmake-2.8.11.2
./configure
make &&  make install
cd ..
tar zxf mariadb-5.5.32.tar.gz
cd mariadb-5.5.32
cmake . -DCMAKE_INSTALL_PREFIX=$db_install_prefix \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DMYSQL_DATADIR=/data/mariadb \
-DSYSCONFDIR=/etc \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306 \
-DWITH_XTRADB_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_EXTRA_CHARSETS=1 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DWITH_BIG_TABLES=1 \
-DWITH_DEBUG=0
make && make install

/bin/cp support-files/my-small.cnf /etc/my.conf
/bin/cp support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on
cd ..

# my.cf
cat > /etc/my.cnf << EOF
[mysqld]
basedir = /usr/local/mariadb
datadir = /data/mariadb
pid-file = /data/mariadb/mariadb.pid
character-set-server = utf8
collation-server = utf8_general_ci
user = mysql
port = 3306
default_storage_engine = InnoDB
innodb_file_per_table = 1
server_id = 1
log_bin = mysql-bin
binlog_format = mixed
expire_logs_days = 7
bind-address = 0.0.0.0

# name-resolve
skip-name-resolve
skip-host-cache

#lower_case_table_names = 1
ft_min_word_len = 1
query_cache_size = 64M
query_cache_type = 1

skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

# LOG
log_error = /data/mariadb/mariadb-error.log
long_query_time = 1
slow_query_log
slow_query_log_file = /data/mariadb/mariadb-slow.log

# Oher
#max_connections = 1000
open_files_limit = 65535

[client]
port = 3306
EOF

/usr/local/mariadb/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mariadb --datadir=/data/mariadb

chown mysql.mysql -R /data/mariadb
/sbin/service mysqld start
export PATH=$PATH:/usr/local/mariadb/bin
echo 'export PATH=$PATH:/usr/local/mariadb/bin' >> /etc/profile
source /etc/profile

/usr/local/mariadb/bin/mysql -e "grant all privileges on *.* to root@'127.0.0.1' identified by "dbrootpwd" with grant option;"
/usr/local/mariadb/bin/mysql -e "grant all privileges on *.* to root@'localhost' identified by "dbrootpwd" with grant option;"
/usr/local/mariadb/bin/mysql -uroot -pdbrootpwd -e "delete from mysql.user where Password='';"
/usr/local/mariadb/bin/mysql -uroot -pdbrootpwd -e "delete from mysql.db where User='';"
/usr/local/mariadb/bin/mysql -uroot -pdbrootpwd -e "drop database test;"
/sbin/service mysqld restart

The original

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Geoff at November 12, 2013 - 12:57 PM