CentOS 7 mariadb Compilation installation Tutorial Systemctl launch

Source: Internet
Author: User

MARIADB as a replacement for MySQL now the new version of the CentOS package has been replaced with mariadb, just like the previous one. Change to Systemd

Install some libraries

Yum Install GCC GCC wget Net-tools

To view the SELinux status:

/usr/sbin/sestatus-v  

The #如果SELinux status parameter is enabled;
If it is off, you can skip
Modify the/etc/selinux/config file

Vi

Change Selinux=enforcing to Selinux=disabled
Restarting the machine

Download MARIADB installation package to cd/usr/local/src/

cd/usr/local/src/
wget http://mirrors.opencas.cn/mariadb/mariadb-10.0.21/bintar-linux-glibc_214-x86_64/ Mariadb-10.0.21-linux-glibc_214-x86_64.tar.gz

Linux64 bit
Http://mirrors.opencas.cn/mariadb/mariadb-10.0.21/bintar-linux-glibc_214-x86_64/mariadb-10.0.21-linux-glibc_ 214-x86_64.tar.gz

linux32 bit
Http://mirrors.opencas.cn/mariadb/mariadb-10.0.21/bintar-linux-glibc_214-x86/mariadb-10.0.21-linux-glibc_214-i686.tar.gz

Unzip the tarball into the/usr/local directory

tar zvxf mariadb-10.0. -linux-glibc_214-x86_64. tar. Gz-c/usr/local/

Create MARIADB Data Initialization directory/mydata/mysql this way, put MySQL on the cloud disk. MyData as a new mounting disk

mkdir -p/mydata/mysql

Add System user MySQL, disable login system directory owner and group are modified to MySQL here/mydata/mysql to self-server data directory

Useradd-r-s/sbin/nologin MySQL; chown -R mysql.mysql/mydata/mysql/

Make a connection to the MARIADB directory

LN -s/usr/local/mariadb-10.0. -linux-x86_64//usr/local/mysql

Go to Catalog

cd/usr/local/mysql/

Start installation

./scripts/mysql_install_db--datadir=/mydata/mysql--user=mysql

If there is no error, copy the configuration file to the ETC directory

CP SUPPORT-FILES/MY-LARGE.CNF/ETC/MY.CNF

Whether to overwrite the selected Y

To edit the service

Vim/usr/lib/systemd/system/mysql.service

Press I to edit mysql.service in vm_65_centos.pid for your host's name

[Unit]description=MySQL dbms[service]limitnofile=10000Type=Simpleuser =Mysqlgroup=mysqlpidfile=/mydata/mysql/vm_65_centos.pidexecstart=/usr/local/ Mysql/bin/mysqld_safe--datadir=/mydata/mysqlexecstop=/bin/kill -9  $MAINPID [ Install]wantedby=multi-user.target

Save later start

Systemctl Start Mysql.service

Add to self-start

Systemctl Enable Mysql.service

Put MARIADB commands into $path

Path= $PATH:/usr/local/mysql/bin/  #当前有效, restarting the shell will fail echo"export path= $PATH:/usr /local/mysql/bin/" >>/etc/!$

The last step is important. Delete unused user new user

Mysql_secure_installation
Entery EnterEnter the root passwordthen enter the root passwordthen return .EnterEnter to appearAll done! If you ' ve completed all of the above steps, your MariaDB
Installation should now is secure.Thanks for using mariadb!

Ext.: http://bbs.qcloud.com/thread-10758-1-1.html

CentOS 7 mariadb Compilation installation Tutorial Systemctl launch

Related Article

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.