Experiment One: Centos7 binary installation mariadb latest version 10.2.8
1. Check whether the system is installed mariadb
Rpm-qa mariadb*
2, create the system user MySQL, and specify its home directory for/APP/MYSQLDB
Getent passwd MySQL Query If there is a MySQL user useradd-d/app/mysqldb-r-m-s/sbin/nologin MySQL #-R Create System user-M Create home directory-D Specify home directory
3, download mariadb The latest version of the installation package, import into the system
Rz
4. Unpack 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- X86_64/mysql Creating a soft link 5, creating a configuration file/etc/mysql/my.cnf
CD/USR/LOCAL/MYSQL/MKDIR/ETC/MYSQL/CP support-files/my-huge.cnf/etc/mysql/my.cnfvim/etc/mysql/my.cnf [mysqld] DataDir =/app/mysqldb #指定mysql数据库存放目录 innodb_file_per_table=on skip_name_resolve=on
6. Install MySQL Database
scripts/mysql_install_db--user=mysql--datadir=/app/mysqldb
7. Add MySQL Service
CP support-files/mysql.server/etc/init.d/mysqldchkconfig--list mysqldchkconfig--add mysqldservice mysqld start failed
8. 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 6 to install the database again.
9. Add MySQL command to path
vim/etc/profile.d/mysql.sh Path=/usr/local/mysql/bin: $PATH. /etc/profile.d/mysql.sh Effective
10. Security initialization
Mysql_secure_installation User Settings
11. Login with root user test
Mysql-uroot-p Enter a password to log in
Experiment two: Completely remove the installed mariadb
1, query the current mariadb installation situation
Rpm-qa|grep-i mariadb
2, stop the MARIADB service, remove the installed mariadb
Rpm-ev Package name Rpm-ev Package name--nodeps If the prompt depends on the package error, use this command to try RPM-E--noscripts package name if you are prompted with an error: Err:%preun (xxxxxx) Scriptlet failed, exit s Tatus 1, use this command
3. find the old version of mariadb 's directory, and delete the old version of mariadb files and libraries
Find/-name mariadb/var/log/mariadb
4. Delete the corresponding mariadb directory
Rm-rf/var/log/mariadb
5. Note:/ETC/MY.CNF will not be removed after uninstallation, manual removal is required
Rm-rf/etc/my.cnf
6, again check whether the system installed MARIADB, if the query has no results, it is completely uninstalled.
Rpm-qa|grep-i mariadb
This article is from the Linux file system blog, so be sure to keep this source http://13250262.blog.51cto.com/13240262/1972507
Centos7 binary installation and uninstallation mariadb latest version 10.2.8