MARIADB as a replacement for MySQL now CentOS's new version of the Yum package has been replaced with MARIADB
Install some libraries
Yum install gcc gcc-c++ wget net-tools
Copy Code
To view the SELinux status:
/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
Vi/etc/selinux/config
Copy Code
change selinux=enforcing to selinux=disabled
Restarting the machine
Download MARIADB installation package to cd/usr/local/src/
cd/usr/local/src/
Copy Code
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
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
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
Useradd-r-s/sbin/nologin MySQL; chown-r mysql.mysql/mydata/mysql/
Copy Code
Make a connection to the MARIADB directory
Ln-s/usr/local/mariadb-10.0.21-linux-x86_64//usr/local/mysql
Copy Code
Go to Catalog
cd/usr/local/mysql/
Copy Code
Start installation
./scripts/mysql_install_db--datadir=/mydata/mysql--user=mysql
Copy Code
If there is no error, copy the configuration file to the ETC directory
CP SUPPORT-FILES/MY-LARGE.CNF/ETC/MY.CNF
Copy Code
Whether to overwrite the selected Y
Y
Copy Code
Copy the MySQL startup script file into the/ETC/INIT.D directory
CP Support-files/mysql.server/etc/init.d/mysqld
Copy Code
Modify 755 Permissions
chmod 755/etc/init.d/mysqld
Copy Code
Defining data storage paths
Vim/etc/init.d/mysqld
Copy Code
Datadir=/mydata/mysql
Copy Code
Put MARIADB commands into $path
Path= $PATH:/etc/init.d/#当前有效, restarting the shell will expire
echo "Export path= $PATH:/etc/init.d/" >>/etc/profile
echo "Export path= $PATH:/usr/local/mysql/bin/" >>/etc/profile
SOURCE!$
Copy Code
Start MARIADB
/etc/init.d/mysqld start
Copy Code
The last step is important. Delete unused user new user
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)