MariaDB is used as the mySQL database software for Analytics databases. Version 10.0.x is the currently supported version.
rpm -qa | grep -i mysql-server
If one exists, remove it before proceeding.
yum -y install perl-DBI
Create a custom MariaDB version 10.0.x YUM repository. The following example shows
information for a CentOS 7 installation. For more information, see https://downloads.mariadb.org/mariadb/repositories
As the root user, navigate to the /etc/yum.repos.d
Edit a file with vi called MariaDB.repo and
cut and paste the following text into the file.
# MariaDB 10.0 CentOS repository list #http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.0/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
- As the root user, navigate to the /etc/yum.repos.d directory.
When the MariaDB.repo file is in place, install the MariaDB
yum -y install mariadb-server
Add the following configuration settings:
echo "[mysqld]" >> /etc/my.cnf echo "table_open_cache=16K" >> /etc/my.cnf echo "table_definition_cache=16K" >> /etc/my.cnf echo "tmp_table_size=2G" >> /etc/my.cnf echo "max_heap_table_size=2G" >> /etc/my.cnf echo "join_buffer_size=512K" >> /etc/my.cnf echo "open_files_limit=200000" >> /etc/my.cnf echo "tmpdir=/tmp" >> /etc/my.cnf echo "wait_timeout=86400" >> /etc/my.cnf echo "innodb_adaptive_hash_index=OFF" >> /etc/my.cnf echo "innodb_buffer_pool_size=6G" >> /etc/my.cnf echo "innodb_log_file_size=1892M" >> /etc/my.cnf echo "innodb_log_buffer_size=128M" >> /etc/my.cnf
Start the MariaDB mysql server for the first time:
/etc/init.d/mysql startYou can confirm success by connecting to the database server as follows:
mysql -u root
If mysql fails to start, it is highly likely you have a /etc/my.cnf configuration file misconfiguration or environmental preparation was not completed correctly. You can check the /var/lib/mysql/<server fqdn>.err file for details of why startup was not successful. You should correct any issues and confirm successful server start before proceeding further with the installation.
Set MariaDB to start on boot:
systemctl enable mysql
Optionally, if you wish to enable remote access to the database server (that is, you
have opened port 3306), you can grant remote access to the root and
reporting_read users (Analytics installation will
create the later as a read-only user otherwise.)
mysql -u root grant all privileges on *.* to 'root'@'%' with grant option; grant all privileges on *.* to 'reporting'@'%' with grant option; flush privileges;