Centos7.0安装Mysql5.7

前端之家收集整理的这篇文章主要介绍了Centos7.0安装Mysql5.7前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_502_0@[root@localhost soft]# rpm -qa | grep -i MysqL

@H_502_0@MysqL-python-1.2.3-11.el7.x86_64

@H_502_0@PHP-MysqL-5.4.16-36.1.el7_2.1.x86_64

@H_502_0@[root@localhost soft]# yum -y remove MysqL-python

@H_502_0@已加载插件:fastestmirror,langpacks

@H_502_0@正在解决依赖关系

@H_502_0@--> 正在检查事务

@H_502_0@---> 软件包 MysqL-python.x86_64.0.1.2.3-11.el7 将被 删除

@H_502_0@--> 解决依赖关系完成

@H_502_0@依赖关系解决

@H_502_0@=============================================================================================================================

@H_502_0@Package 架构 版本 源 大小

@H_502_0@=============================================================================================================================

@H_502_0@正在删除:

@H_502_0@MysqL-python x86_64 1.2.3-11.el7 @/MysqL-python-1.2.3-11.el7.x86_64 231 k

@H_502_0@事务概要

@H_502_0@=============================================================================================================================

@H_502_0@移除 1 软件包

@H_502_0@安装大小:231 k

@H_502_0@Downloading packages:

@H_502_0@Running transaction check

@H_502_0@Running transaction test

@H_502_0@Transaction test succeeded

@H_502_0@Running transaction

@H_502_0@ 正在删除 : MysqL-python-1.2.3-11.el7.x86_64 1/1

@H_502_0@ 验证中 : MysqL-python-1.2.3-11.el7.x86_64 1/1

@H_502_0@删除:

@H_502_0@ MysqL-python.x86_64 0:1.2.3-11.el7

@H_502_0@完毕!

@H_502_0@[root@localhost soft]# yum -y remove PHP-MysqL

@H_502_0@已加载插件:fastestmirror,langpacks

@H_502_0@正在解决依赖关系

@H_502_0@--> 正在检查事务

@H_502_0@---> 软件包 PHP-MysqL.x86_64.0.5.4.16-36.1.el7_2.1 将被 删除

@H_502_0@--> 解决依赖关系完成

@H_502_0@依赖关系解决

@H_502_0@=============================================================================================================================

@H_502_0@Package 架构 版本 源 大小

@H_502_0@=============================================================================================================================

@H_502_0@正在删除:

@H_502_0@PHP-MysqL x86_64 5.4.16-36.1.el7_2.1 @updates 232 k

@H_502_0@事务概要

@H_502_0@=============================================================================================================================

@H_502_0@移除 1 软件包

@H_502_0@安装大小:232 k

@H_502_0@Downloading packages:

@H_502_0@Running transaction check

@H_502_0@Running transaction test

@H_502_0@Transaction test succeeded

@H_502_0@Running transaction

@H_502_0@ 正在删除 : PHP-MysqL-5.4.16-36.1.el7_2.1.x86_64 1/1

@H_502_0@ 验证中 : PHP-MysqL-5.4.16-36.1.el7_2.1.x86_64 1/1

@H_502_0@删除:

@H_502_0@ PHP-MysqL.x86_64 0:5.4.16-36.1.el7_2.1

@H_502_0@完毕!

@H_502_0@[root@localhost soft]# groupadd MysqL

@H_502_0@[root@localhost soft]# useradd -r -g MysqL MysqL

@H_502_0@[root@localhost soft]# yum install MysqL-community-{client,common,libs}-*

@H_502_0@已加载插件:fastestmirror,langpacks

@H_502_0@正在检查 MysqL-community-client-5.7.12-1.el7.x86_64.rpm: MysqL-community-client-5.7.12-1.el7.x86_64

@H_502_0@MysqL-community-client-5.7.12-1.el7.x86_64.rpm 将被安装

@H_502_0@正在检查 MysqL-community-common-5.7.12-1.el7.x86_64.rpm: MysqL-community-common-5.7.12-1.el7.x86_64

@H_502_0@MysqL-community-common-5.7.12-1.el7.x86_64.rpm 将被安装

@H_502_0@正在检查 MysqL-community-libs-5.7.12-1.el7.x86_64.rpm: MysqL-community-libs-5.7.12-1.el7.x86_64

@H_502_0@MysqL-community-libs-5.7.12-1.el7.x86_64.rpm 将被安装

@H_502_0@正在检查 MysqL-community-libs-compat-5.7.12-1.el7.x86_64.rpm: MysqL-community-libs-compat-5.7.12-1.el7.x86_64

@H_502_0@MysqL-community-libs-compat-5.7.12-1.el7.x86_64.rpm 将被安装

@H_502_0@正在解决依赖关系

@H_502_0@--> 正在检查事务

@H_502_0@---> 软件包 mariadb.x86_64.1.5.5.47-1.el7_2 将被 取代

@H_502_0@---> 软件包 mariadb-libs.x86_64.1.5.5.47-1.el7_2 将被 取代

@H_502_0@---> 软件包 MysqL-community-client.x86_64.0.5.7.12-1.el7 将被 舍弃

@H_502_0@---> 软件包 MysqL-community-common.x86_64.0.5.7.12-1.el7 将被 安装

@H_502_0@---> 软件包 MysqL-community-libs.x86_64.0.5.7.12-1.el7 将被 舍弃

@H_502_0@---> 软件包 MysqL-community-libs-compat.x86_64.0.5.7.12-1.el7 将被 舍弃

@H_502_0@--> 解决依赖关系完成

@H_502_0@依赖关系解决

@H_502_0@=============================================================================================================================

@H_502_0@Package 架构 版本 源 大小

@H_502_0@=============================================================================================================================

@H_502_0@正在安装:

@H_502_0@MysqL-community-client x86_64 5.7.12-1.el7 /MysqL-community-client-5.7.12-1.el7.x86_64 106 M

@H_502_0@ 替换 mariadb.x86_64 1:5.5.47-1.el7_2

@H_502_0@MysqL-community-common x86_64 5.7.12-1.el7 /MysqL-community-common-5.7.12-1.el7.x86_64 2.5 M

@H_502_0@MysqL-community-libs x86_64 5.7.12-1.el7 /MysqL-community-libs-5.7.12-1.el7.x86_64 9.5 M

@H_502_0@ 替换 mariadb-libs.x86_64 1:5.5.47-1.el7_2

@H_502_0@MysqL-community-libs-compat x86_64 5.7.12-1.el7 /MysqL-community-libs-compat-5.7.12-1.el7.x86_64 9.2 M

@H_502_0@ 替换 mariadb-libs.x86_64 1:5.5.47-1.el7_2

@H_502_0@事务概要

@H_502_0@=============================================================================================================================

@H_502_0@安装 4 软件包

@H_502_0@总计:127 M

@H_502_0@Is this ok [y/d/N]: y

@H_502_0@Downloading packages:

@H_502_0@Running transaction check

@H_502_0@Running transaction test

@H_502_0@Transaction test succeeded

@H_502_0@Running transaction

@H_502_0@ 正在安装 : MysqL-community-common-5.7.12-1.el7.x86_64 1/6

@H_502_0@ 正在安装 : MysqL-community-libs-5.7.12-1.el7.x86_64 2/6

@H_502_0@ 正在安装 : MysqL-community-client-5.7.12-1.el7.x86_64 3/6

@H_502_0@ 正在安装 : MysqL-community-libs-compat-5.7.12-1.el7.x86_64 4/6

@H_502_0@ 正在删除 : 1:mariadb-5.5.47-1.el7_2.x86_64 5/6

@H_502_0@ 正在删除 : 1:mariadb-libs-5.5.47-1.el7_2.x86_64 6/6

@H_502_0@ 验证中 : MysqL-community-client-5.7.12-1.el7.x86_64 1/6

@H_502_0@ 验证中 : MysqL-community-common-5.7.12-1.el7.x86_64 2/6

@H_502_0@ 验证中 : MysqL-community-libs-5.7.12-1.el7.x86_64 3/6

@H_502_0@ 验证中 : MysqL-community-libs-compat-5.7.12-1.el7.x86_64 4/6

@H_502_0@ 验证中 : 1:mariadb-5.5.47-1.el7_2.x86_64 5/6

@H_502_0@ 验证中 : 1:mariadb-libs-5.5.47-1.el7_2.x86_64 6/6

@H_502_0@已安装:

@H_502_0@ MysqL-community-client.x86_64 0:5.7.12-1.el7 MysqL-community-common.x86_64 0:5.7.12-1.el7

@H_502_0@ MysqL-community-libs.x86_64 0:5.7.12-1.el7 MysqL-community-libs-compat.x86_64 0:5.7.12-1.el7

@H_502_0@替代:

@H_502_0@ mariadb.x86_64 1:5.5.47-1.el7_2 mariadb-libs.x86_64 1:5.5.47-1.el7_2

@H_502_0@完毕!

@H_502_0@[root@localhost soft]#

@H_502_0@[root@localhost soft]# rpm -qa | grep -i MysqL

@H_502_0@MysqL-community-libs-compat-5.7.12-1.el7.x86_64

@H_502_0@MysqL-community-common-5.7.12-1.el7.x86_64

@H_502_0@MysqL-community-libs-5.7.12-1.el7.x86_64

@H_502_0@MysqL-community-client-5.7.12-1.el7.x86_64

@H_502_0@[root@localhost soft]# pwd

@H_502_0@/soft

@H_502_0@[root@localhost soft]# ll

@H_502_0@总用量 1106888

@H_502_0@-rwxr-xr-x. 1 root root 566722560 5月 21 10:25 MysqL-5.7.12-1.el7.x86_64.rpm-bundle.tar

@H_502_0@-rwxr-xr-x. 1 7155 31415 24991304 3月 29 15:38 MysqL-community-client-5.7.12-1.el7.x86_64.rpm

@H_502_0@-rwxr-xr-x. 1 7155 31415 276736 3月 29 15:38 MysqL-community-common-5.7.12-1.el7.x86_64.rpm

@H_502_0@-rwxr-xr-x. 1 7155 31415 3786120 3月 29 15:38 MysqL-community-devel-5.7.12-1.el7.x86_64.rpm

@H_502_0@-rwxr-xr-x. 1 7155 31415 45150068 3月 29 15:38 MysqL-community-embedded-5.7.12-1.el7.x86_64.rpm

@H_502_0@-rwxr-xr-x. 1 7155 31415 23829224 3月 29 15:38 MysqL-community-embedded-compat-5.7.12-1.el7.x86_64.rpm

@H_502_0@-rwxr-xr-x. 1 7155 31415 124953868 3月 29 15:39 MysqL-community-embedded-devel-5.7.12-1.el7.x86_64.rpm

@H_502_0@-rwxr-xr-x. 1 7155 31415 2237968 3月 29 15:39 MysqL-community-libs-5.7.12-1.el7.x86_64.rpm

@H_502_0@-rwxr-xr-x. 1 7155 31415 2115948 3月 29 15:39 MysqL-community-libs-compat-5.7.12-1.el7.x86_64.rpm

@H_502_0@-rwxr-xr-x. 1 7155 31415 51016520 3月 29 15:40 MysqL-community-minimal-debuginfo-5.7.12-1.el7.x86_64.rpm

@H_502_0@-rwxr-xr-x. 1 7155 31415 158252992 3月 29 15:40 MysqL-community-server-5.7.12-1.el7.x86_64.rpm

@H_502_0@-rwxr-xr-x. 1 7155 31415 13998408 3月 29 15:41 MysqL-community-server-minimal-5.7.12-1.el7.x86_64.rpm

@H_502_0@-rwxr-xr-x. 1 7155 31415 116098332 3月 29 15:41 MysqL-community-test-5.7.12-1.el7.x86_64.rpm

@H_502_0@[root@localhost soft]# yum install MysqL-community-server

@H_502_0@已加载插件:fastestmirror,langpacks

@H_502_0@Loading mirror speeds from cached hostfile

@H_502_0@* base: mirrors.neusoft.edu.cn

@H_502_0@* extras: mirrors.yun-idc.com

@H_502_0@* updates: mirrors.tuna.tsinghua.edu.cn

@H_502_0@没有可用软件包 MysqL-community-server。

@H_502_0@错误:无须任何处理

@H_502_0@[root@localhost soft]# rpm -ivh MysqL-community-server-

@H_502_0@MysqL-community-server-5.7.12-1.el7.x86_64.rpm MysqL-community-server-minimal-5.7.12-1.el7.x86_64.rpm

@H_502_0@[root@localhost soft]# rpm -ivh MysqL-community-server-5.7.12-1.el7.x86_64.rpm

@H_502_0@警告:MysqL-community-server-5.7.12-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature,密钥 ID 5072e1f5: NOKEY

@H_502_0@准备中... ################################# [100%]

@H_502_0@正在升级/安装...

@H_502_0@ 1:MysqL-community-server-5.7.12-1.e################################# [100%]

@H_502_0@[root@localhost soft]# rpm -ivh MysqL-community-devel-5.7.12-1.el7.x86_64.rpm

@H_502_0@警告:MysqL-community-devel-5.7.12-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature,密钥 ID 5072e1f5: NOKEY

@H_502_0@准备中... ################################# [100%]

@H_502_0@正在升级/安装...

@H_502_0@ 1:MysqL-community-devel-5.7.12-1.el################################# [100%]

@H_502_0@[root@localhost soft]# rpm -qa | grep -i MysqL

@H_502_0@MysqL-community-libs-compat-5.7.12-1.el7.x86_64

@H_502_0@MysqL-community-common-5.7.12-1.el7.x86_64

@H_502_0@MysqL-community-server-5.7.12-1.el7.x86_64

@H_502_0@MysqL-community-libs-5.7.12-1.el7.x86_64

@H_502_0@MysqL-community-devel-5.7.12-1.el7.x86_64

@H_502_0@MysqL-community-client-5.7.12-1.el7.x86_64

@H_502_0@[root@localhost soft]#

@H_502_0@[root@localhost soft]# MysqL

@H_502_0@ERROR 2002 (HY000): Can't connect to local MysqL server through socket '/var/lib/MysqL/MysqL.sock' (2)

@H_502_0@[root@localhost soft]# MysqL -u MysqL -p -S /var/lib/MysqL/MysqL.sock

@H_502_0@Enter password:

@H_502_0@ERROR 2002 (HY000): Can't connect to local MysqL server through socket '/var/lib/MysqL/MysqL.sock' (2)

@H_502_0@[root@localhost soft]# chown -R MysqL:MysqL /var/lib/MysqL

@H_502_0@[root@localhost soft]# service MysqLd start

@H_502_0@Redirecting to /bin/systemctl start MysqLd.service

@H_502_0@[root@localhost soft]# ps -el | grep MysqLd

@H_502_0@1 S 1001 6503 1 1 80 0 - 466720 poll_s ? 00:00:00 MysqLd

@H_502_0@[root@localhost soft]# MysqL

@H_502_0@ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

@H_502_0@[root@localhost soft]# MysqL -u root -p

@H_502_0@Enter password:

@H_502_0@ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

@H_502_0@[root@localhost soft]# MysqLadmin -u root flush-privileges password "newpassword"

@H_502_0@MysqLadmin: connect to server at 'localhost' Failed

@H_502_0@error: 'Access denied for user 'root'@'localhost' (using password: NO)'

@H_502_0@[root@localhost soft]# service MysqLd start

@H_502_0@Redirecting to /bin/systemctl start MysqLd.service

@H_502_0@[root@localhost soft]# grep 'temporary password' /var/log/MysqLd.log

@H_502_0@2016-05-21T04:01:25.452939Z 1 [Note] A temporary password is generated for root@localhost: iM.OOzNGO3gG(临时密码)

@H_502_0@[root@localhost soft]# MysqL -u root -p

@H_502_0@Enter password:

@H_502_0@Welcome to the MysqL monitor. Commands end with ; or \g.

@H_502_0@Your MysqL connection id is 5

@H_502_0@Server version: 5.7.12

@H_502_0@Copyright (c) 2000,2016,Oracle and/or its affiliates. All rights reserved.

@H_502_0@Oracle is a registered trademark of Oracle Corporation and/or its

@H_502_0@affiliates. Other names may be trademarks of their respective

@H_502_0@owners.

@H_502_0@Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

@H_502_0@MysqL> ALTER USER 'root'@'localhost' IDENTIFIED BY '1qaz@WSX';

@H_502_0@Query OK,0 rows affected (0.10 sec)

猜你在找的CentOS相关文章