rpm安装mysql5.7.11_rpm方式安装mysql-5.7.11

1、rpm bundel包下载到 /usr/local/src中:[root@localhost src]# ls

mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar

2解压缩bundle包[root@localhost src]# tar xf mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar

[root@localhost src]# ls

mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar

mysql-community-client-5.7.11-1.el6.x86_64.rpm

mysql-community-common-5.7.11-1.el6.x86_64.rpm

mysql-community-devel-5.7.11-1.el6.x86_64.rpm

mysql-community-embedded-5.7.11-1.el6.x86_64.rpm

mysql-community-embedded-devel-5.7.11-1.el6.x86_64.rpm

mysql-community-libs-5.7.11-1.el6.x86_64.rpm

mysql-community-libs-compat-5.7.11-1.el6.x86_64.rpm

mysql-community-server-5.7.11-1.el6.x86_64.rpm

mysql-community-test-5.7.11-1.el6.x86_64.rpm

安装必须组件:yum install numactl

yum install libaio

yum install perl-Time-HiRes per-devel

3.安装mysql-community-server之前,必须安装mysql-community-client和mysql-community-common  rpm包。而安装community-client和community-common包之前,必须删除mysql-lib(系统自带的版本过低)[root@localhost src]# rpm -qa | grep mysql

mysql-libs-5.1.73-3.el6_5.x86_64

[root@localhost src]# yum remove mysql-libs

Loaded plugins: fastestmirror, refresh-packagekit, security

Existing lock /var/run/yum.pid: another copy is running as pid 19475.

Another app is currently holding the yum lock; waiting for it to exit...

The other application is: PackageKit

Memory :  39 M RSS (569 MB VSZ)

Dependencies Resolved

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

Package                              Arch                         Version                                Repositor

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

Removing:

mysql-libs                           x86_64                       5.1.73-3.el6_5                         @anaconda

Removing for dependencies:

cronie                               x86_64                       1.4.4-12.el6                           @anaconda

cronie-anacron                       x86_64                       1.4.4-12.el6                           @anaconda

crontabs                             noarch                       1.10-33.el6                            @anaconda

postfix                              x86_64                       2:2.6.6-6.el6_5                        @anaconda

sysstat                              x86_64                       9.0.4-27.el6                           @anaconda

Transaction Summary

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

Remove        6 Package(s)

Installed size: 15 M

Is this ok [y/N]: y

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Erasing    : sysstat-9.0.4-27.el6.x86_64

Erasing    : cronie-1.4.4-12.el6.x86_64

Erasing    : cronie-anacron-1.4.4-12.el6.x86_64

Erasing    : crontabs-1.10-33.el6.noarch

Erasing    : 2:postfix-2.6.6-6.el6_5.x86_64

Erasing    : mysql-libs-5.1.73-3.el6_5.x86_64

Verifying  : cronie-anacron-1.4.4-12.el6.x86_64

Verifying  : mysql-libs-5.1.73-3.el6_5.x86_64

Verifying  : sysstat-9.0.4-27.el6.x86_64

Verifying  : crontabs-1.10-33.el6.noarch

Verifying  : cronie-1.4.4-12.el6.x86_64

Verifying  : 2:postfix-2.6.6-6.el6_5.x86_64

Removed:

mysql-libs.x86_64 0:5.1.73-3.el6_5

Dependency Removed:

cronie.x86_64 0:1.4.4-12.el6    cronie-anacron.x86_64 0:1.4.4-12.el6    crontabs.noarch 0:1.10-33.el6    postfix.

Complete!

4.上面卸载了mysql-lib旧的包,现在安装mysql-lib最新版的文件,这个包在rpm-bundle里面都有,

直接安装即可[root@localhost src]# rpm -ivh mysql-community-common-5.7.11-1.el6.x86_64.rpm

warning: mysql-community-common-5.7.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing...                ########################################### [100%]

1:mysql-community-common ########################################### [100%][root@localhost src]# ls

mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar        mysql-community-embedded-5.7.11-1.el6.x86_64.rpm        mysql-commu

mysql-community-client-5.7.11-1.el6.x86_64.rpm  mysql-community-embedded-devel-5.7.11-1.el6.x86_64.rpm  mysql-commu

mysql-community-common-5.7.11-1.el6.x86_64.rpm  mysql-community-libs-5.7.11-1.el6.x86_64.rpm

mysql-community-devel-5.7.11-1.el6.x86_64.rpm   mysql-community-libs-compat-5.7.11-1.el6.x86_64.rpm

[root@localhost src]# rpm -ivh mysql-community-libs-5.7.11-1.el6.x86_64.rpm

warning: mysql-community-libs-5.7.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing...                ########################################### [100%]

1:mysql-community-libs   ########################################### [100%]

[root@localhost src]# rpm -ivh mysql-community-client-5.7.11-1.el6.x86_64.rpm

warning: mysql-community-client-5.7.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing...                ########################################### [100%]

1:mysql-community-client ########################################### [100%]

[root@localhost src]# rpm -ivh mysql-community-server-5.7.11-1.el6.x86_64.rpm

warning: mysql-community-server-5.7.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing...                ########################################### [100%]

1:mysql-community-server ########################################### [100%]

5.启动mysql 服务[root@localhost src]# service mysql start

mysql: unrecognized service

[root@localhost src]# service mysqld start

Initializing MySQL database:                               [  OK  ]

Installing validate password plugin:                       [  OK  ]

Starting mysqld:                                           [  OK  ]

[root@localhost src]# netstat -tlunp

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name

tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1525/sshd

tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      1384/cupsd

tcp        0      0 :::22                       :::*                        LISTEN      1525/sshd

tcp        0      0 ::1:631                     :::*                        LISTEN      1384/cupsd

tcp        0      0 :::3306                     :::*                        LISTEN      19928/mysqld

udp        0      0 0.0.0.0:68                  0.0.0.0:*                               19346/dhclient

udp        0      0 0.0.0.0:631                 0.0.0.0:*                               1384/cupsd

6.rpm安装mysql后,会自动初始化一个密码,在日志中[root@localhost src]# cat /var/log/mysqld.log | more

2016-03-11T01:44:19.913630Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --ex

plicit_defaults_for_timestamp server option (see documentation for more details).

2016-03-11T01:44:22.271099Z 0 [Warning] InnoDB: New log files created, LSN=45790

2016-03-11T01:44:22.584299Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.

2016-03-11T01:44:23.050146Z 0 [Warning] No existing UUID has been found, so we assume that this is the first

time that this server has been started. Generating a new UUID: c7bf1a6a-e72a-11e5-8737-000c29a05942.

2016-03-11T01:44:23.062259Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cann

ot be opened.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

2016-03-11T01:44:23.093873Z 1 [Note] A temporary password is generated for root@localhost: 8%

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

2016-03-11T01:44:28.470492Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --ex

plicit_defaults_for_timestamp server option (see documentation for more details).

2016-03-11T01:44:28.471726Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.11) starting as process 19672 ...

2016-03-11T01:44:28.626135Z 0 [Note] InnoDB: PUNCH HOLE support available

2016-03-11T01:44:28.626205Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2016-03-11T01:44:28.626220Z 0 [Note] InnoDB: Uses event mutexes

2016-03-11T01:44:28.626233Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier

7.修改 mysql root密码,由于最新的mysql版本对密码策略有要求,所以必须增加复杂程度才能通过

注意,用刚才的随机密码登陆mysql.[root@localhost src]# mysql -uroot -p

Enter password: 此处输入刚才日志文件中的随机密码

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

Your MySQL connection id is 14

Server version: 5.7.11

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> set password='Yes@126.com';

Query OK, 0 rows affected (0.15 sec)

mysql> quit;

Bye

[root@localhost src]# mysql -uroot -p

Enter password:

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

Your MySQL connection id is 15

Server version: 5.7.11 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只允许locathost本地登陆,用mysql workbentch 是无法远程登陆的。

root@localhost,代表root只允许本地用户登陆,

所以必须允许root 从任何ip地址登陆。mysql> grant all privileges on *.* to 'root'@'%' identified by 'Yes@126.com';

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值