CENTOS7 installation mariadb (MySQL replacement)

Source: Internet
Author: User

MARIADB as a replacement for MySQL now CentOS's new version of the Yum package has been replaced with MARIADB

Install some libraries

    1. Yum install gcc gcc-c++ wget net-tools

Copy Code

To view the SELinux status:

    1. /usr/sbin/sestatus-v

Copy Code

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

    1. Vi/etc/selinux/config

Copy Code

change selinux=enforcing to selinux=disabled
Restarting the machine

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

    1. cd/usr/local/src/

Copy Code

    1. 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

Copy Code


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

    1. Tar zvxf mariadb-10.0.21-linux-glibc_214-x86_64.tar.gz-c/usr/local/

Copy Code

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

    1. Mkdir-p/mydata/mysql

Copy Code

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

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

Copy Code

Make a connection to the MARIADB directory

    1. Ln-s/usr/local/mariadb-10.0.21-linux-x86_64//usr/local/mysql

Copy Code

Go to Catalog

    1. cd/usr/local/mysql/

Copy Code

Start installation

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

Copy Code

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

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

Copy Code

Whether to overwrite the selected Y

    1. Y

Copy Code

Copy the MySQL startup script file into the/ETC/INIT.D directory

    1. CP Support-files/mysql.server/etc/init.d/mysqld

Copy Code

Modify 755 Permissions

    1. chmod 755/etc/init.d/mysqld

Copy Code

Defining data storage paths

    1. Vim/etc/init.d/mysqld

Copy Code

    1. Datadir=/mydata/mysql

Copy Code

Put MARIADB commands into $path

    1. Path= $PATH:/etc/init.d/#当前有效, restarting the shell will expire

    2. echo "Export path= $PATH:/etc/init.d/" >>/etc/profile

    3. echo "Export path= $PATH:/usr/local/mysql/bin/" >>/etc/profile

    4. SOURCE!$

Copy Code

Start MARIADB

    1. /etc/init.d/mysqld start

Copy Code


The last step is important. Delete unused user new user

    1. Mysql_secure_installation

Copy Code


Enter

Y Enter

Enter the root password

Then enter the root password

Then return.

Enter

Enter to appear

All done! If you ' ve completed all of the above steps, your MariaDB
Installation should now is secure.

Thanks for using mariadb!


This article is from the "Savage Power" blog, please be sure to keep this source http://chenfei123.blog.51cto.com/1427669/1875929

CENTOS7 installation mariadb (MySQL replacement)

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.