Install MARIADB on REDHAT7

Source: Internet
Author: User

Compiling and installing MARIADB
  1. Download mariadb
    # wget http://mirrors.opencas.cn/mariadb//mariadb-10.1.8/source/mariadb-10.1.8.tar.gz
  2. Decompression MARIADB
    # TAR-ZXVF mariadb-10.1.8.tar.gz && CD mariadb-10.1.8
  3. Installing dependent software
    # yum-y Install gcc-c++ cmake ncurses-devel Bison libxml2-devel openssl-devel
  4. compiling and installing MARIADB
    #cmake . -dcmake_install_prefix=/usr/local /mysql -dmysql_datadir=/data/mysql - dsysconfdir=/etc
    If you compile an error, you need to remove CMakeCache.txt and then recompile
    #  after installing the dependent software; Make && make install
  5. Create MARIADB service run users and user groups
    # Groupadd MySQL
    # useradd-g mysql -s/bin/nologin MySQL
  6. Create a MARIADB Data directory and modify the genus Group
    #  mkdir-p/data/mysql && chown-r mysql:mysql/data/mysql
  7. According to server performance, copy the corresponding MARIADB configuration file
    # CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-LARGE.CNF/ETC/MY.CNF
  8. Installing the MARIADB Database
    #/usr/local/mysql/scripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/data/mysql--user=mysql
  9. Create a mariadb startup script
    # Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld
  10. Set up the MARIADB service to boot from
    # chmod +x/etc/init.d/mysqld
    # Chkconfig Mysqld on
  11. Start the MARIADB service
    # service Mysqld Start
  12. Set MARIADB System Variables
    #  echo "Export path=\ $PATH:/usr/local/mysql/bin" >/etc/profile.d/mysqld.sh
    # source/etc/profile.d/mysqld.sh
  13. Initializing the MARIADB Security configuration
    # mysql_secure_installation
Note:

Compile parameter list

# CMake. -dcmake_install_prefix=/usr/local/MySQL-dmysql_datadir=/data/MySQL-dsysconfdir=/etc-dmysql_user=MySQL-dwith_innobase_storage_engine=1 -dwith_archive_stprage_engine=1 -dwith_blackhole_storage_engine=1 -dwiyh_readline=1 -dwiyh_ssl=system-dvith_zlib=system-dwith_lobwrap=0 -dmysql_tcp_port=3306 -dmysql_unix_addr=/tmp/Mysql.sock-ddefault_charset=UTF8-ddefault_collation=utf8_general_ci

If you want to specify MARIADB installation location and data directory location, you can modify the/etc/init.d/mysqld

basedir=/usr/local/Mysqldatadir=/data/mysql
Yum installation mariadb
  1. Add MariaDB repo
    # Vi/etc/yum.repo.d/mariadb.repo
     # MariaDB 10.1  CentOS repository list-created 2015  -12 -  : 46  utc# http:  // mariadb.org/mariadb/repositories/  [Mariadb]name  = Mariadbbaseurl  = Http://  yum.mariadb.org/10.1/centos7-amd64  Gpgkey=https: // yum.mariadb.org/rpm-gpg-key-mariadb  gpgcheck= 1  
  2. Installing MARIADB
    # yum-y Install Mariadb-server mariadb-client
  3. Set up the MARIADB service to boot from
    # Systemctl Enable MARIADB
  4. Start the MARIADB service
    # Systemctl Start mariadb
  5. Initializing the MARIADB Security configuration
    # mysql_secure_installation

Create MySQL Users and user groups

Install MARIADB on REDHAT7

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.