[root@bogon develop]# yum remove mysql-libs
运行该命令删除原来的依赖库,一路输入y,直到成功
接下来安装mysql:
[root@localhost gwtt]#
[root@localhost gwtt]# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm#rpm-ivhmysql-community-release-el7-5.noarch.rpm
--2016-02-17 18:46:05-- http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
正在解析主机 dev.mysql.com (dev.mysql.com)... 137.254.60.11
正在连接 dev.mysql.com (dev.mysql.com)|137.254.60.11|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
位置:http://repo.mysql.com//mysql-community-release-el7-5.noarch.rpm [跟随至新的 URL]
--2016-02-17 18:46:06-- http://repo.mysql.com//mysql-community-release-el7-5.noarch.rpm
正在解析主机 repo.mysql.com (repo.mysql.com)... 23.205.235.136
正在连接 repo.mysql.com (repo.mysql.com)|23.205.235.136|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:6140 (6.0K) [application/x-redhat-package-manager]
正在保存至: “mysql-community-release-el7-5.noarch.rpm.4”
100%[=========================================================>] 6,140 --.-K/s 用时 0s
2016-02-17 18:46:07 (790 MB/s) - 已保存 “mysql-community-release-el7-5.noarch.rpm.4” [6140/6140])
[root@localhost gwtt]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
[root@localhost gwtt]# yum install mysql-community-server
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirrors.btte.net
* updates: mirrors.btte.net
正在解决依赖关系
--> 正在检查事务
---> 软件包 mysql-community-server.x86_64.0.5.6.29-2.el7 将被 安装
--> 正在处理依赖关系 mysql-community-common(x86-64) = 5.6.29-2.el7,它被软件包 mysql-community-server-5.6.29-2.el7.x86_64 需要
--> 正在处理依赖关系 mysql-community-client(x86-64) = 5.6.29-2.el7,它被软件包 mysql-community-server-5.6.29-2.el7.x86_64 需要
--> 正在检查事务
---> 软件包 mysql-community-client.x86_64.0.5.6.29-2.el7 将被 安装
--> 正在处理依赖关系 mysql-community-libs(x86-64) = 5.6.29-2.el7,它被软件包 mysql-community-client-5.6.29-2.el7.x86_64 需要
---> 软件包 mysql-community-common.x86_64.0.5.6.29-2.el7 将被 安装
--> 正在检查事务
---> 软件包 mysql-community-libs.x86_64.0.5.6.29-2.el7 将被 安装
--> 解决依赖关系完成
依赖关系解决
===================================================================================================
Package 架构 版本 源 大小
===================================================================================================
正在安装:
mysql-community-server x86_64 5.6.29-2.el7 mysql56-community 58 M
为依赖而安装:
mysql-community-client x86_64 5.6.29-2.el7 mysql56-community 19 M
mysql-community-common x86_64 5.6.29-2.el7 mysql56-community 256 k
mysql-community-libs x86_64 5.6.29-2.el7 mysql56-community 2.0 M
事务概要
===================================================================================================
安装 1 软件包 (+3 依赖软件包)
总计:79 M
安装大小:344 M
Is this ok [y/d/N]: y
Downloading packages:
警告:/var/cache/yum/x86_64/7/mysql56-community/packages/mysql-community-common-5.6.29-2.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
从 file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql 检索密钥
导入 GPG key 0x5072E1F5:
用户ID : "MySQL Release Engineering <[email protected]>"
指纹 : a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
软件包 : mysql-community-release-el7-5.noarch (installed)
来自 : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
是否继续?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : mysql-community-common-5.6.29-2.el7.x86_64 1/4
正在安装 : mysql-community-libs-5.6.29-2.el7.x86_64 2/4
正在安装 : mysql-community-client-5.6.29-2.el7.x86_64 3/4
正在安装 : mysql-community-server-5.6.29-2.el7.x86_64 4/4
验证中 : mysql-community-common-5.6.29-2.el7.x86_64 1/4
验证中 : mysql-community-libs-5.6.29-2.el7.x86_64 2/4
验证中 : mysql-community-client-5.6.29-2.el7.x86_64 3/4
验证中 : mysql-community-server-5.6.29-2.el7.x86_64 4/4
已安装:
mysql-community-server.x86_64 0:5.6.29-2.el7
作为依赖被安装:
mysql-community-client.x86_64 0:5.6.29-2.el7 mysql-community-common.x86_64 0:5.6.29-2.el7
mysql-community-libs.x86_64 0:5.6.29-2.el7
完毕!
[root@localhost gwtt]# yum
install
mysql-server
[root@localhost gwtt]# systemctl start mysqld.service
//测试一下是否成功
[root@localhost gwtt]#
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 2
Server version: 5.6.29 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>
//如果出现Welcome to the MySQL monitor. 和mysql>表示安装成功
//开始学习mysql之旅
//mysql默认的密码为mysql,可以再Linux下使用mysqladmin -u root password 'gwtt'设置密码
//也可以在mysql中设置密码
mysql> mysql -u root mysql
mysql> SET password=PASSWORD('gwtt');//注意后面有分号
//如果出现Welcome to the MySQL monitor. 和mysql>表示安装成功
//开始学习mysql之旅
//mysql的常用命令
//mysql的root用户的初始密码为mysql
1.使用下面的命令修改root的密码
mysql> SET password=PASSWORD('gwtt');
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql>
//当然也可以在linux的用户下修改root的密码