1. See if the system is installed
Rpm-qa mariadb*
2. Create the system user MySQL and specify its home directory as/app/mysqldb
①getent passwd mysql②useradd-d/app/mysqldb-r-m-s/sbin/nologin mysql #-r create system user-M Create home directory-D Specify home directory
3. Unzip the installation package to/usr/local
①tar xvf mariadb-10.2.8-linux-x86_64.tar.gz-c/usr/local/##-c hi Specifies the destination directory for unpacking ②cd/usr/local/③ln-s mariadb-10.2.8-linux-x 86_64/mysql # #创建软连接
4. Create a configuration file/etc/mysql/my.cnf
①cd/usr/local/mysql/
②mkdir/etc/mysql/
③CP support-files/my-huge.cnf/etc/mysql/my.cnf
④vim/etc/mysql/my.cnf
[Mysqld]
DataDir =/app/mysqldb # #指定mysql数据库存放目录
Innodb_file_per_table = On
Skip_name_resolve = On
5. Install MySQL Database
scripts/mysql_install_db--user=mysql--datadir=/app/mysqldb
6. Add Mysqld Service
①CP support-files/mysql.server/etc/init.d/mysqld②chkconfig--list mysqld③chkconfig--add mysqld④service mysqld start Kai Failed to move
7. Turn on MySQL service
①mkdir/var/log/mariadb/②chown mysql/var/log/mariadb/③service mysqld Start open successfully
Note: If this step turns on the service failure and you are prompted not to find the database, repeat step 5 to install the database again
8. Add mysqld command to path Path
①vim/etc/profile.d/mysql.shpath=/usr/local/mysql/bin: $PATH ②. /etc/profile.d/mysql.sh
9. Security initialization
Mysql_secure_installation
10. Login with root user test
Mysql-uroot-p ' Root_password ' Enter the password, login success!!
CENTOS7 binary Installation mariadb latest version 10.2.8