Linux Environment RPM installation MYSQL5.6
System Environment CentOS7.2
1. Turn off SELinux service "SELinux is a domain-type model (DOMAIN-TYPE)-based mandatory access control (MAC) security system"
[root@OperationsAnalysis ~]# vim /etc/selinux/config ···SELINUX=disabled···
2. Turn off the Firewall service and disable boot boot
[root@OperationsAnalysis ~]# systemctl stop firewalld.service[root@OperationsAnalysis ~]# systemctl disable firewalld.service
3. Turn off the NetworkManager service and disable power-on startup "(Networmanager) is the program that detects the network and automatically connects to the network."
[root@OperationsAnalysis ~]# systemctl stop NetworkManager.service[root@OperationsAnalysis ~]# systemctl disable NetworkManager.service
4. Check if the system has a MySQL installation package, if you have removed it using RPM-E
[root@OperationsAnalysis ~]# rpm -qa| grep mysql
5. Download the mysql5.6 installation package and upload it to the server
[[email protected] MySQL]# Lltotal236180-rw-r--r--1 root root20278972 Sep2215:mysql-client-5.6.31-1.el7.x86_64.rpm-rw-r--r--1 root root3529244 Sep2215:mysql-devel-5.6.31-1.el7.x86_64.rpm-rw-r--r--1 root root92246408 Sep2215:mysql-embedded-5.6.31-1.el7.x86_64.rpm-rw-r--r--1 root root61732192 Sep2215:mysql-server-5.6.31-1.el7.x86_64.rpm-rw-r--r--1 root root2101912 Sep 22 15:42 mysql-shared-5.6.31- 1.el7.x86_64.rpm-rw-r--r--1 root root 2299648 Sep 22 15:40 mysql-shared-compat-5.6.31- 1.el7.x86_64.rpm-rw-r--r--1 root root 59644132 Sep 22 15:40 mysql-test-5.6.31- 1.el7.x86_64.rpm
6. Install the MySQL installation package
[Email protected] mysql]#Rpm-ivh mysql-server-5.6 .31-1.el7.x86_64 .rpm [[email protected] mysql]# rpm -ivh mysql-devel-5 .6.31-1.el7 .x86_64.rpm [[email Protected] mysql]# rpm -ivh mysql-client-5< Span class= "Hljs-class" >.6.31-1.el7.rpm
7. Modify the MY.CNF configuration file location
/usr/share/mysql/my-default.cnf /etc/my.cnf
8. Modify the character set and datastore path configuration/etc/my.cnf file, set the following key values to enable useful options and the UTF-8 character set.
[[email protected] ~]# cat /etc/my.cnf[mysqld]···innodb_file_per_tablemax_connections = 4096collation-server = utf8_general_cicharacter-set-server = utf8
9. Initialize MySQL and set password
[[email protected] ~]#/usr/bin/mysql_install_db[[email protected] ~]# service MySQLstart[[email protected] ~]# cat/root/.mysql_secret# The random password set for the Root user at Mon Dec 26 20:43:34 2016 (local time): 1dwioryeiapscytm[[email protected] ~]# mysql-uroot-p1dwioryeiapscytmmysql> Span class= "Hljs-keyword" >set password = PASSWORD ( ' abcd1234 '); Query OK, 0 rows Affected (0.00 sec)
10. Setting up MySQL Boot
[root@OperationsAnalysis ~]# systemctl restart mysqld.service[root@OperationsAnalysis ~]# systemctl enable mysqld.service
11. Set MySQL to allow remote login
12. Installing MySQL installation package incompatibility issue
[Email protected] mysql]# RPM-IVH mysql-server-5.6.31-1.el7.x86_64.rpmwarning:mysql-server-5.6.31-1.el7.x86_64. Rpm:header V3 dsa/sha1 Signature, key ID 5072e1f5:nokeypreparing ... ########################### ###### [100%] File/usr/share/mysql/charsets/readme fromInstallof mysql-server-5.6.31-1.el7.x86_64 conflictsWithFileFromPackage mariadb-libs-1:5.5.41-2.el7_0.x86_64file/usr/Share/mysql/czech/errmsg.SysFromInstallof mysql-server-5.6.31-1.el7.x86_64 conflictsWithFileFromPackage mariadb-libs-1:5.5.41-2.el7_0.x86_64file/usr/Share/mysql/danish/errmsg.SysFromInstallof mysql-server-5.6.31-1.el7.x86_64 conflictsWithFileFrompackage mariadb-libs-1:5.5.41-2.el7_0.x86_64 file/usr/share/mysql/dutch/errmsg. sys from install of mysql-server-5.6 .31-1.el7.x86_64 conflicts with Span class= "Hljs-keyword" >file from package mariadb-libs-< Span class= "Hljs-number" >1:5.5.41- 2.el7_0.x86_64
Workaround, remove the incompatible installation package
[[email protected] mysql]# rpm-qa |grep mariadb*mariadb-libs-5.5.41-2.el7_0.x86_64< Span class= "hljs-list" >[[email protected] mysql]# rpm-e mariadb-libs-5.5.41-2.el7_ 0.x86_64 (with dependency packages, recommended to use Yum removal) error:failed dependencies:libmysqlclient.so.18 () (64bit) is needed by ( Installed) postfix-2:2.10.1-6.el7.x86_64 libmysqlclient.so.18 ( libmysqlclient_18) (64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64[[ Email protected] mysql]# yum Remove mariadb-libs*-y
Linux environment rpm installation MYSQL5.6