R1-003 MySQL的rpm安装实例

1、解压tar包

[root@hhu MySQL]# tar -xvf mysql-5.7.17-1.el6.x86_64.rpm-bundle.tar

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

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

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

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

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

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

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

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

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

[root@hhu MySQL]# ls

mysql-5.7.17-1.el6.x86_64.rpm-bundle.tar mysql-community-embedded-devel-5.7.17-1.el6.x86_64.rpm

mysql-community-client-5.7.17-1.el6.x86_64.rpm mysql-community-libs-5.7.17-1.el6.x86_64.rpm

mysql-community-common-5.7.17-1.el6.x86_64.rpm mysql-community-libs-compat-5.7.17-1.el6.x86_64.rpm

mysql-community-devel-5.7.17-1.el6.x86_64.rpm mysql-community-server-5.7.17-1.el6.x86_64.rpm

mysql-community-embedded-5.7.17-1.el6.x86_64.rpm mysql-community-test-5.7.17-1.el6.x86_64.rpm

2、卸载已有老版本MySQL

[root@hhu MySQL]# rpm -qa|grep mysql

mysql-5.1.71-1.el6.x86_64

mysql-devel-5.1.71-1.el6.x86_64

mysql-libs-5.1.71-1.el6.x86_64

[root@hhu MySQL]# rpm -e mysql-5.1.71-1.el6.x86_64

error: Failed dependencies:

mysql = 5.1.71-1.el6 is needed by (installed) mysql-devel-5.1.71-1.el6.x86_64

[root@hhu MySQL]# rpm -e mysql-devel-5.1.71-

[root@hhu MySQL]# rpm -qa|grep mysql

mysql-5.1.71-1.el6.x86_64

mysql-libs-5.1.71-1.el6.x86_64

[root@hhu MySQL]# rpm -e mysql-5.1.71-1.el6.x86_64

[root@hhu MySQL]# rpm -e mysql-libs-5.1.71-1.el6.x86_64

error: Failed dependencies:

libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64

libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64

mysql-libs is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64

[root@hhu MySQL]# rpm -e mysql-libs-5.1.71-1.el6.x86_64 --nodeps 强制卸载

[root@hhu MySQL]# rpm -qa|grep mysql

[root@hhu MySQL]#

3、安装MySQL包,一共5个,会有依赖关系,安装顺序如下:

rpm -Uvh mysql-community-common-5.7.17-1.el6.x86_64.rpm

rpm -Uvh mysql-community-libs-5.7.17-1.el6.x86_64.rpm

rpm -Uvh mysql-community-libs-compat-5.7.17-1.el6.x86_64.rpm

rpm -Uvh mysql-community-client-5.7.17-1.el6.x86_64.rpm

rpm -Uvh mysql-community-server-5.7.17-1.el6.x86_64.rpm

[root@hhu MySQL]# ls

mysql-5.7.17-1.el6.x86_64.rpm-bundle.tar mysql-community-embedded-devel-5.7.17-1.el6.x86_64.rpm

mysql-community-client-5.7.17-1.el6.x86_64.rpm mysql-community-libs-5.7.17-1.el6.x86_64.rpm

mysql-community-common-5.7.17-1.el6.x86_64.rpm mysql-community-libs-compat-5.7.17-1.el6.x86_64.rpm

mysql-community-devel-5.7.17-1.el6.x86_64.rpm mysql-community-server-5.7.17-1.el6.x86_64.rpm

mysql-community-embedded-5.7.17-1.el6.x86_64.rpm mysql-community-test-5.7.17-1.el6.x86_64.rpm

[root@hhu MySQL]# rpm -Uvh mysql-community-common-5.7.17-1.el6.x86_64.rpm

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

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

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

[root@hhu MySQL]# rpm -Uvh mysql-community-libs-5.7.17-1.el6.x86_64.rpm

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

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

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

[root@hhu MySQL]# rpm -Uvh mysql-community-libs-compat-5.7.17-1.el6.x86_64.rpm

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

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

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

[root@hhu MySQL]# rpm -Uvh mysql-community-client-5.7.17-1.el6.x86_64.rpm

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

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

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

[root@hhu MySQL]# rpm -Uvh mysql-community-server-5.7.17-1.el6.x86_64.rpm

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

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

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

[root@hhu MySQL]# service mysqld status

mysqld is stopped

[root@hhu MySQL]# service mysqld start

Initializing MySQL database: [ OK ]

Installing validate password plugin: [ OK ]

Starting mysqld: [ OK ]

4、获取超级数据库用户临时密码,登录,修改密码

[root@hhu MySQL]# grep 'temporary password' /var/log/mysqld.log

2017-02-23T01:36:39.249352Z 1 [Note] A temporary password is generated for root@localhost: i7NmqxstDZ?L

[root@hhu MySQL]# mysql -uroot -p

Enter password:

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

Your MySQL connection id is 4

Server version: 5.7.17

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> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';

Query OK, 0 rows affected (0.00 sec)

mysql> quit

Bye

时间: 2024-09-23 22:49:58

R1-003 MySQL的rpm安装实例的相关文章

R1-002 MySQL的rpm安装方式

Installing MySQL on Linux Using RPM Packages from Oracle 基于rpm的Linux MySQL安装包的推荐安装方式是使用Oracle提供的rpm包来安装.对于社区版的MySQL,有两种方式来获取安装包:MySQL的软件库(包括MySQL yum源和MySQL sles库).MySQL开发者空间的下载MySQL社区版服务器界面. 用于安装MySQL的rpm包如下: Table 2.6 RPM Packages for MySQL Communi

R1-004 如何激活MySQL的rpm安装方式的Shell

用root用户安装MySQL后,会自动创建一个名为mysql的组和一个名为mysql的系统用户,但是无法从root用户切换到mysql用户: [root@hhu MySQL]# su - mysql [root@hhu MySQL]# su - mysql  原因是刚刚安装的mysql用户的Shell设置问题,可以从/etc/passwd文件看出 [root@hhu home]# cat /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:

suse rpm安装mysql的过程

suse mysql 5.0.18-16.i586 rpm 安装过程 主要是解决依赖的一些问题,以前是把包下载的到硬盘上的,只需要mount就可以了然后查找 mysql 1) find / -name "mysql*" -print 显示如下: /usr/share/doc/packages/postfix/html/mysql_table.5.html /usr/share/man/man5/mysql_table.5.gz /usr/share/susehelp/meta/Manu

mysql的安装与mysql一机多实例(低版本)

mysql的安装与mysql一机多实例(低版本) 在写这篇文档之前,我查了一些资料,不知是简单的原因还是什么其他原因,各个资料都写的相当的模糊,所以,我详细的做了一次,并写成了文档分享给大家       首先我们用的是Linux redhat 4.6 系统,mysql的版本为mysql-5.0.18.tar.gz,内核版本如下图: 本文理论的东西,不在详加解释,只讲安装完成部署一机多实例.目前具本人了解,一机多实例实现的方法大体有三种,第一mysql多次安装,并安装在不同的目录,第二.就是,用m

mysql centos-centos上通过rpm安装mysql失败

问题描述 centos上通过rpm安装mysql失败 具体如下: [root@localhost 下载]# rpm -ivh MySQL-server-5.5.46-1.linux2.6.x86_64.rpm --nosignature 准备中... ################################# [100%] Giving mysqld 5 seconds to exit nicely 正在升级/安装... 1:MySQL-server-5.5.46-1.linux2.6

redhat下安装mysql 5.6.20,解压zip包,查看已经安装过的mysql,卸载rpm安装包,安装mysql服务器端和客户端,修改mysql用户名,登陆mysql,启动关闭mysql

 1 将相关的mysql rpm包上传到redhat上 2  我的电脑是Redhat 6.*版本,所以这里使用上面一个 3  解压zip包 4  安装以下几个rpm MySQL-client-advanced-5.6.20-1.el6.x86_64.rpm MySQL-server-advanced-5.6.20-1.el6.x86_64.rpm 5  查看已经安装过的mysql rpm –aq | grep mysql 结果: mysql-libs-5.1.66-2.el6_3.x86_6

centos6中 rpm安装mysql出错问题解决方法

[root@cch rpm]# rpm -ivh MySQL-server-5.5.29-1.rhel5.x86_64.rpm error: Failed dependencies:libaio.so.1()(64bit) is needed by MySQL-server-5.5.29-1.rhel5.x86_64 libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-server-5.5.29-1.rhel5.x86_64 libaio.so.1

MySQL 源码scr.rpm安装的一点注意事项

    rpm安装包通常为二进制包(Binary)以及源代码包(Source)两种形式.在使用源码方式安装MySQL的时候,官方网站上下载的源码包通常为scr.rpm格式,而不是直接的tar包,对此,需要先使用rpm命令先安装源码后在进行编译安装,本文是对该方式的描述.   1.下载源码包  http://mirrors.sohu.com/mysql/MySQL-5.6/  http://dev.mysql.com/downloads/mysql/   2.安装rpm#环境suse11:~ #

Mysql 5.6.24安装实例教程_Mysql

安装前准备工作: 1)编辑PATH路径 vim /etc/profile PATH=/home/mysql/bin:/home/mysql/lib:$PATH export PATH 2)生效PATH source /etc/profile 3)编辑hosts vim /etc/hosts 192.168.117.130 cc-test 安装 1.环境配置 yum install - y gcc gcc-c++ make cmake 2.准备好安装包mysql-5.6.24.tar.gz,并将它