CentOS7.2 MySQL-5.7.18 RPM Bundle版をインストールします(最新版5.7.20に適用)


一、環境
1、オペレーティングシステム:CentOS Linux release 7.2.1511(Core)最小化インストール版2、MySQLバージョン:MySQL-5.7.18(mysql-5.7.1.18-1.el 7.x 86_64.rpm-bundle.tar)
二、設置過程
1、wgetをインストールします.
[root@Geeklp-MySQL ~]# yum -y install wget

2、インストールパッケージをダウンロードします.
wget -c http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.18-1.el5.i686.rpm-bundle.tar

3、かばんを解く.
[root@Geeklp-MySQL ~]# tar -xf mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar

4、各rpmパケットおよびその他の依存パケットを以下のスクリプト順にインストールします.
#!/bin/bash
yum -y install net-tools
tar -xf mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar &
yum -y remove mariadb-libs
rpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm 
rpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm 
rpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm
yum -y install perl-Getopt-Long
rpm -ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm 
yum -y install perl-Data-Dumper
yum -y install perl-JSON
rpm -ivh mysql-community-test-5.7.18-1.el7.x86_64.rpm 
rpm -ivh mysql-community-devel-5.7.18-1.el7.x86_64.rpm

5、MySQLサービスを起動し、初期パスワードを記録する.
[root@Geeklp-MySQL ~]# systemctl start mysqld
[root@Geeklp-MySQL ~]# cat /var/log/mysqld.log |grep password
2017-12-13T10:50:44.960028Z 1 [Note] A temporary password is generated for root@localhost: =mWoe;zkj4M3

これで、インストールプロセスが完了します.
三、配置過程
1、初めてログインして、ログインパスワードを変更します.
[root@Geeklp-MySQL ~]# # mysql -u root -p 
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.18
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SET PASSWORD = PASSWORD('xwumpmysql,./');
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> SET PASSWORD = PASSWORD('Geeklp.0/7');
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> quit;
Bye

2、データディレクトリを作成し、myを修正する.cfnプロファイル.
[root@Geeklp-MySQL ~]# mkdir /home/data
[root@Geeklp-MySQL ~]# mv /var/lib/mysql /home/data/
[root@Geeklp-MySQL ~]# vi /etc/my.cnf
default-storage-engine=INNODB 
lower_case_table_names = 1

詳細については、以下を参照してください.https://dev.mysql.com/doc/refman/5.7/en/mysqld-option-tables.html権限のリセットについては、次を参照してください.https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html