Compile and install MARIADB database in CentOS6.7 system _mariadb

Source: Internet
Author: User
Tags localhost mysql mkdir

Environment: Centos6.7,minimal installation.

Prerequisite: Installed the compilation environment, installed Apache.

1, download decompression

# wget http://archive.mariadb.org//mariadb-5.5.44/bintar-linux-x86/mariadb-5.5.44-linux-i686.tar.gz
# tar XF Mariadb-5.5.44-linux-x86_64.tar.gz-c/usr/local
# cd/usr/local

2, create the Data directory

# Mkdir-pv/mydata/data

3. Add Users and Groups

# useradd-r MySQL
#chown-R mysql.mysql/mydata/data

4. Add Connection File

# cd/usr/local
# LN-SV Mariadb-5.5.44-linux-x86_64/mysql

5. Change file owner and group

# cd/usr/local/mysql
# chown-r root.mysql./*

6. Initializing the database

[root@localhost mysql]# scripts/mysql_install_db --datadir=/mydata/data/ --user=mysql

Note: When initializing here, the following data directory and MY.CNF directory must remain, otherwise the MYSQLD service will not start.

7, set the configuration file

# mkdir/etc/mysql #
CP support-files/my-large.cnf/etc/mysql/my.cnf/
# VIM/ETC/MYSQL/MY.CNF

8. Provide service script

# cp Support-files/mysql.server/etc/rc.d/init.d/mysqld
# chmod +x/etc/rc.d/init.d/mysqld
# chkconfig--add Mysqld
# service mysqld start

9, testing

# ss -tnl

10. Import Binary Execution path

# vim/etc/profile.d/mysqld.sh
  export path=/usr/local/mysql/bin: $PATH
#/etc/profile.d/mysqld.sh

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.