database/mysql

[mysql] CentOS 에서 MySQL 5.7 설치

labj 2017. 8. 27. 13:42


http://www.koreaoug.org/dbms/2039


MySQL 사이트에서 Yum Repository 사용한 설치를 위해 아래 이름의 파일을 다운 받는다. down

  mysql57-community-release-el6-8.noarch.rpm


[root@testora ~]# yum search mysql-community

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

 * base: ftp.daumkakao.com

 * extras: ftp.daumkakao.com

 * updates: ftp.daumkakao.com

============================================================= N/S Matched: mysql-community =============================================================

mysql-community-client.i686 : MySQL database client applications and tools

mysql-community-client.x86_64 : MySQL database client applications and tools

mysql-community-common.i686 : MySQL database common files for server and client libs

mysql-community-common.x86_64 : MySQL database common files for server and client libs

mysql-community-devel.i686 : Development header files and libraries for MySQL database client applications

mysql-community-devel.x86_64 : Development header files and libraries for MySQL database client applications

mysql-community-embedded.i686 : MySQL embedded library

mysql-community-embedded.x86_64 : MySQL embedded library

mysql-community-embedded-devel.i686 : Development header files and libraries for MySQL as an embeddable library

mysql-community-embedded-devel.x86_64 : Development header files and libraries for MySQL as an embeddable library

mysql-community-libs.i686 : Shared libraries for MySQL database client applications

mysql-community-libs.x86_64 : Shared libraries for MySQL database client applications

mysql-community-libs-compat.i686 : Shared compat libraries for MySQL 5.1.72 database client applications

mysql-community-libs-compat.x86_64 : Shared compat libraries for MySQL 5.1.72 database client applications

mysql-community-release.noarch : MySQL repository configuration for yum

mysql-community-server.x86_64 : A very fast and reliable SQL database server

mysql-community-test.x86_64 : Test suite for the MySQL database server

 

  Name and summary matches only, use "search all" for everything.

[root@testora ~]#

[root@testora ~]# yum install mysql-server

Loaded plugins: fastestmirror, refresh-packagekit, security

Setting up Install Process

Loading mirror speeds from cached hostfile

 * base: ftp.daumkakao.com

 * extras: ftp.daumkakao.com

 * updates: ftp.daumkakao.com

Package mysql-server is obsoleted by mysql-community-server, trying to install mysql-community-server-5.7.15-1.el6.x86_64 instead

Resolving Dependencies

--> Running transaction check

---> Package mysql-community-server.x86_64 0:5.7.15-1.el6 will be installed

--> Processing Dependency: mysql-community-common(x86-64) = 5.7.15-1.el6 for package: mysql-community-server-5.7.15-1.el6.x86_64

--> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.15-1.el6.x86_64

--> Running transaction check

---> Package mysql-community-client.x86_64 0:5.7.15-1.el6 will be installed

--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.15-1.el6.x86_64

---> Package mysql-community-common.x86_64 0:5.7.15-1.el6 will be installed

--> Running transaction check

---> Package mysql-community-libs.x86_64 0:5.7.15-1.el6 will be obsoleting

---> Package mysql-libs.x86_64 0:5.1.73-5.el6_6 will be obsoleted

--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: 2:postfix-2.6.6-6.el6_7.1.x86_64

--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: 2:postfix-2.6.6-6.el6_7.1.x86_64

--> Running transaction check

---> Package mysql-community-libs-compat.x86_64 0:5.7.15-1.el6 will be obsoleting

--> Finished Dependency Resolution

 

Dependencies Resolved

 

========================================================================================================================================================

 Package                                        Arch                      Version                            Repository                            Size

========================================================================================================================================================

Installing:

 mysql-community-libs                           x86_64                    5.7.15-1.el6                       mysql57-community                    2.1 M

     replacing  mysql-libs.x86_64 5.1.73-5.el6_6

 mysql-community-libs-compat                    x86_64                    5.7.15-1.el6                       mysql57-community                    1.6 M

     replacing  mysql-libs.x86_64 5.1.73-5.el6_6

 mysql-community-server                         x86_64                    5.7.15-1.el6                       mysql57-community                    144 M

Installing for dependencies:

 mysql-community-client                         x86_64                    5.7.15-1.el6                       mysql57-community                     23 M

 mysql-community-common                         x86_64                    5.7.15-1.el6                       mysql57-community                    327 k

 

Transaction Summary

========================================================================================================================================================

Install       5 Package(s)

 

Total download size: 170 M

Is this ok [y/N]: y

Downloading Packages:

(1/5): mysql-community-client-5.7.15-1.el6.x86_64.rpm                                                                            |  23 MB     00:20     

(2/5): mysql-community-common-5.7.15-1.el6.x86_64.rpm                                                                            | 327 kB     00:00     

(3/5): mysql-community-libs-5.7.15-1.el6.x86_64.rpm                                                                              | 2.1 MB     00:03     

(4/5): mysql-community-libs-compat-5.7.15-1.el6.x86_64.rpm                                                                       | 1.6 MB     00:02     

http://repo.mysql.com/yum/mysql-5.7-community/el/6/x86_64/mysql-community-server-5.7.15-1.el6.x86_64.rpm: [Errno 14] PYCURL ERROR 56 - "Failure when receiving data from the peer"

Trying other mirror.

 

 

Error Downloading Packages:

  mysql-community-server-5.7.15-1.el6.x86_64: failure: mysql-community-server-5.7.15-1.el6.x86_64.rpm from mysql57-community: [Errno 256] No more mirrors to try.

 

[root@testora ~]# 

 

다운로드에 실패할 경우 다시 시도하게 되면 실패한 파일을 받으면서 이후 과정이 진행된다.

 

[root@testora ~]# yum install mysql-server

Loaded plugins: fastestmirror, refresh-packagekit, security

Setting up Install Process

Loading mirror speeds from cached hostfile

 * base: ftp.daumkakao.com

 * extras: ftp.daumkakao.com

 * updates: ftp.daumkakao.com

Package mysql-server is obsoleted by mysql-community-server, trying to install mysql-community-server-5.7.15-1.el6.x86_64 instead

Resolving Dependencies

--> Running transaction check

---> Package mysql-community-server.x86_64 0:5.7.15-1.el6 will be installed

--> Processing Dependency: mysql-community-common(x86-64) = 5.7.15-1.el6 for package: mysql-community-server-5.7.15-1.el6.x86_64

--> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.15-1.el6.x86_64

--> Running transaction check

---> Package mysql-community-client.x86_64 0:5.7.15-1.el6 will be installed

--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.15-1.el6.x86_64

---> Package mysql-community-common.x86_64 0:5.7.15-1.el6 will be installed

--> Running transaction check

---> Package mysql-community-libs.x86_64 0:5.7.15-1.el6 will be obsoleting

---> Package mysql-libs.x86_64 0:5.1.73-5.el6_6 will be obsoleted

--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: 2:postfix-2.6.6-6.el6_7.1.x86_64

--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: 2:postfix-2.6.6-6.el6_7.1.x86_64

--> Running transaction check

---> Package mysql-community-libs-compat.x86_64 0:5.7.15-1.el6 will be obsoleting

--> Finished Dependency Resolution

 

Dependencies Resolved

 

========================================================================================================================================================

 Package                                        Arch                      Version                            Repository                            Size

========================================================================================================================================================

Installing:

 mysql-community-libs                           x86_64                    5.7.15-1.el6                       mysql57-community                    2.1 M

     replacing  mysql-libs.x86_64 5.1.73-5.el6_6

 mysql-community-libs-compat                    x86_64                    5.7.15-1.el6                       mysql57-community                    1.6 M

     replacing  mysql-libs.x86_64 5.1.73-5.el6_6

 mysql-community-server                         x86_64                    5.7.15-1.el6                       mysql57-community                    144 M

Installing for dependencies:

 mysql-community-client                         x86_64                    5.7.15-1.el6                       mysql57-community                     23 M

 mysql-community-common                         x86_64                    5.7.15-1.el6                       mysql57-community                    327 k

 

Transaction Summary

========================================================================================================================================================

Install       5 Package(s)

 

Total size: 170 M

Total download size: 144 M

Is this ok [y/N]: y

Downloading Packages:

mysql-community-server-5.7.15-1.el6.x86_64.rpm                                                                                   | 144 MB     00:40     

경고: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

Importing GPG key 0x5072E1F5:

 Userid : MySQL Release Engineering <mysql-build@oss.oracle.com>

 Package: mysql57-community-release-el6-8.noarch (installed)

 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

Is this ok [y/N]: y

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Warning: RPMDB altered outside of yum.

  Installing : mysql-community-common-5.7.15-1.el6.x86_64                                                                                           1/6 

  Installing : mysql-community-libs-5.7.15-1.el6.x86_64                                                                                             2/6 

  Installing : mysql-community-client-5.7.15-1.el6.x86_64                                                                                           3/6 

  Installing : mysql-community-server-5.7.15-1.el6.x86_64                                                                                           4/6 

  Installing : mysql-community-libs-compat-5.7.15-1.el6.x86_64                                                                                      5/6 

  Erasing    : mysql-libs-5.1.73-5.el6_6.x86_64                                                                                                     6/6 

  Verifying  : mysql-community-common-5.7.15-1.el6.x86_64                                                                                           1/6 

  Verifying  : mysql-community-libs-5.7.15-1.el6.x86_64                                                                                             2/6 

  Verifying  : mysql-community-client-5.7.15-1.el6.x86_64                                                                                           3/6 

  Verifying  : mysql-community-server-5.7.15-1.el6.x86_64                                                                                           4/6 

  Verifying  : mysql-community-libs-compat-5.7.15-1.el6.x86_64                                                                                      5/6 

  Verifying  : mysql-libs-5.1.73-5.el6_6.x86_64                                                                                                     6/6 

 

Installed:

  mysql-community-libs.x86_64 0:5.7.15-1.el6     mysql-community-libs-compat.x86_64 0:5.7.15-1.el6     mysql-community-server.x86_64 0:5.7.15-1.el6    

 

Dependency Installed:

  mysql-community-client.x86_64 0:5.7.15-1.el6                               mysql-community-common.x86_64 0:5.7.15-1.el6                              

 

Replaced:

  mysql-libs.x86_64 0:5.1.73-5.el6_6                                                                                                                    

 

Complete!

[root@testora ~]#


[root@testora etc]# chkconfig mysqld on

[root@testora etc]# service mysqld start

MySQL 데이타베이스 초기화 중:  [  OK  ]

Installing validate password plugin:  [  OK  ]

mysqld (을)를 시작 중:  [  OK  ]

[root@testora etc]#


[root@testora etc]# service mysqld stop

mysqld 를 정지 중:  [  OK  ]

[root@testora etc]# service mysqld start --skip-grant-tables

mysqld (을)를 시작 중:  [  OK  ]

[root@testora etc]# mysql -u root mysql

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

 

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.7.15 MySQL Community Server (GPL)

 

Copyright (c) 2000, 2016, 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> update user set authentication_string=password('mysql') where user='root';

Query OK, 1 row affected, 1 warning (0.01 sec)

Rows matched: 1  Changed: 1  Warnings: 1

 

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

 

mysql> exit

Bye

[root@testora etc]# service mysqld restart

mysqld 를 정지 중:  [  OK  ]

mysqld (을)를 시작 중:  [  OK  ]

[root@testora etc]# 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.15

 

Copyright (c) 2000, 2016, 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> select 1;

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

mysql> SET PASSWORD = PASSWORD('Mysql1234!@#$');

Query OK, 0 rows affected, 1 warning (0.00 sec)

 

mysql> select 1;

+---+

| 1 |

+---+

| 1 |

+---+

1 row in set (0.00 sec)

 

mysql> show variables like 'validate_password%';

+--------------------------------------+--------+

| Variable_name                        | Value  |

+--------------------------------------+--------+

| validate_password_check_user_name    | OFF    |

| validate_password_dictionary_file    |        |

| validate_password_length             | 8      |

| validate_password_mixed_case_count   | 1      |

| validate_password_number_count       | 1      |

| validate_password_policy             | MEDIUM |

| validate_password_special_char_count | 1      |

+--------------------------------------+--------+

7 rows in set (0.00 sec)

 

mysql>