MariaDB-server installation of MySQL series

MariaDB-server installation of MySQL series

Tutorial Series

MySQL series: Basic concepts of MySQL relational database
MySQL Series II Multi-Instance Configuration
MySQL Series 3 Basics
MySQL Series 4 SQL Syntax
MySQL series five views, stored functions, stored procedures, triggers
MySQL series 6 users and authorization
MySQL Series 7 MySQL Storage Engine
MySQL Series 8 MySQL Server Variables
MySQL series 9 MySQL query cache and index
MySQL Series 10 MySQL Transaction Isolation to Implement Concurrency Control
MySQL Series 11 Logging
MySQL Series 12 Backup and Recovery
MySQL Series 13 MySQL Replication
MySQL Series 14 MySQL High Availability Implementation
MySQL series 15 MySQL common configuration and performance stress test

1. Install MariaDB-server using the yum package manager

1) Configure yum source (MariaDB official source)

[root@centos6 ~]# vim /etc/yum.repos.d/mariadb-10.2.repo
[mariadb]
name=MariaDB
baseurl=http://yum.mariadb.org/10.2/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

2) Installation

[root@centos6 ~]# yum -y install MariaDB-server

3) Start the service and test

[root@centos6 ~]# service mysql start
[root@centos6 mysql]# mysql #If the connection is successful, it means OK!

2. Install MariaDB-server using the official binary package

1) Get the binary package

# wget http://sfo1.mirrors.digitalocean.com/mariadb//mariadb-10.2.15/bintar-linux-x86_64/mariadb-10.2.15-linux-x86_64.tar.gz

2) Create groups and users

[root@centos6 ~]# groupadd -r -g 27 mysql
[root@centos6 ~]# useradd -r -u 27 -g 27 -m -d /data/mysqldb -s /sbin/nologin mysql

3) Unzip the software package and modify permissions

[root@centos6 ~]# tar xf mariadb-10.2.15-linux-x86_64.tar.gz -C /usr/local/
[root@centos6 ~]# cd /usr/local/
[root@centos6 local]# ln -s mariadb-10.2.15-linux-x86_64/mysql
[root@centos6 local]# chown -R root:root mysql/
[root@centos6 local]# setfacl -R -mu:mysql:rwx mysql/

4) Set environment variables

[root@centos6 local]# echo "export PATH=/usr/local/mysql/bin:\$PATH" >/etc/profile.d/mysql.sh
[root@centos6 local]# ./etc/profile.d/mysql.sh

5) Initialize the database

[root@centos6 local]# cd /usr/local/mysql/ #You must enter this directory to execute the initialization script [root@centos6 mysql]# scripts/mysql_install_db --datadir=/data/mysqldb/ --user=mysql

6) Provide configuration files

[root@centos6 mysql]# cp support-files/my-huge.cnf /etc/my.cnf
[root@centos6 mysql]# sed -i.bak '/\[mysqld\]/adatadir = /data/mysqldb' /etc/my.cnf

7) Provide startup service script

[root@centos6 mysql]# cp support-files/mysql.server /etc/init.d/mysqld
[root@centos6 mysql]# chkconfig --add mysqld
[root@centos6 mysql]# chkconfig mysqld on

8) Start and test

[root@centos6 mysql]# service mysqld start
[root@centos6 mysql]# mysql #If the connection is successful, it means OK!

3. Compile and install MariaDB-server from source

1) Get the source code

# wget http://ftp.hosteurope.de/mirror/archive.mariadb.org//mariadb-10.2.15/source/mariadb-10.2.15.tar.gz

2) Prepare the basic environment

[root@centos6 ~]# yum -y install bison bison-devel zlib-devel libcurl-devel libarchive-devel boost-devel gcc gcc-c++ cmake libevent-devel gnutls-devel libaio-devel openssl-devel ncurses-devel libxml2-devel 

3) Create groups and users

[root@centos6 ~]# groupadd -r -g 27 mysql
[root@centos6 ~]# useradd -r -u 27 -g 27 -m -d /data/mysqldb -s /sbin/nologin mysql

4) Compile and install

[root@centos6 ~]# tar xf mariadb-10.2.15.tar.gz 
[root@centos6 ~]# cd mariadb-10.2.15
[root@centos6 mariadb-10.2.15]# cmake . \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/data/mysqldb/ \
-DSYSCONFDIR=/etc \
-DMYSQL_USER=mysql \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITHOUT_MROONGA_STORAGE_ENGINE=1 \
-DWITH_DEBUG=0 \
-DWITH_READLINE=1 \
-DWITH_SSL=system \
-DWITH_ZLIB=system \
-DWITH_LIBWRAP=0 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
[root@centos6 mariadb-10.2.15]# make -j4 && make install

​ 5) Configure environment variables and modify software installation directory permissions

[root@centos6 ~]# echo "export PATH=/usr/local/mysql/bin:\$PATH" >/etc/profile.d/mysql.sh
[root@centos6 ~]# . /etc/profile.d/mysql.sh
[root@centos6 ~]# setfacl -R -mu:mysql:rwx /usr/local/mysql/

7) Initialize the database, provide configuration files, and provide service startup scripts

[root@centos6 ~]# cd /usr/local/mysql/
[root@centos6 mysql]# scripts/mysql_install_db --datadir=/data/mysqldb/ --user=mysql --basedir=/usr/local/mysql/
[root@centos6 mysql]# cp support-files/my-huge.cnf /etc/my.cnf
[root@centos6 mysql]# cp support-files/mysql.server /etc/init.d/mysqld
[root@centos6 mysql]# chkconfig --add mysqld

8) Start and test

[root@centos6 mysql]# service mysqld start
[root@centos6 mysql]# mysql #If the connection is successful, it means OK!

This is the end of this article about the installation of MariaDB-server, one of the MySQL series. For more information about the installation of MySQL MariaDB-server, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • MySQL installation diagram MySQL graphic installation tutorial (detailed instructions)
  • Installation and configuration of MySQL 5.6 under Windows with screenshots and detailed instructions
  • MySQL 5.5 installation and configuration method graphic tutorial
  • Install Apache and PHP under Linux; Apache+PHP+MySQL configuration strategy
  • Installation and simple use of MySQL version 5.7 (graphic tutorial)
  • Complete steps to install mysql5.7 on Mac (with pictures and text)
  • Explain MySQL installation and login method under Linux
  • Detailed graphic tutorial on installing MySQL on Windows 10
  • MySQL 5.6.17 Green Edition (Free Installation) Installation and Configuration Tutorial
  • MySQL Installation Detailed Graphic Version (V5.5 For Windows)

<<:  Several methods to modify CSS style to achieve gray web pages (no color, only light black and white)

>>:  Put frameset in body through iframe

Recommend

Example of creating a virtual host based on Apache port

apache: create virtual host based on port Take cr...

Does the website's text still need to be designed?

Many people may ask, does the text on the website...

Detailed explanation of the use of state in React's three major attributes

Table of contents Class Component Functional Comp...

Summary of Mysql exists usage

Introduction EXISTS is used to check whether a su...

Navicat connection MySQL error description analysis

Table of contents environment Virtual Machine Ver...

Reasons and solutions for MySQL sql_mode modification not taking effect

Table of contents Preface Scenario simulation Sum...

Implementation of MySQL select in subquery optimization

The following demonstration is based on MySQL ver...

Using CSS3's 3D effects to create a cube

Learning to use CSS3's 3D effects to create a...

Solution to the problem that Docker container cannot access Jupyter

In this project, the Docker container is used to ...

A detailed analysis and processing of MySQL alarms

Recently, a service has an alarm, which has made ...

HTML design pattern daily study notes

HTML Design Pattern Study Notes This week I mainl...

How to use docker to deploy front-end applications

Docker is becoming more and more popular. It can ...

Introduction to installing JDK under Linux, including uninstalling OpenJDK

1. View openjdk rpm -qa|grep jdk 2. Delete openjd...

Implementation of Docker building Maven+Tomcat basic image

Preface In Java programming, most applications ar...

js realizes a gradually increasing digital animation

Table of contents background Achieve a similar ef...