centos 7登陆mysql_CentOS7.0安装完mysql,无法登陆,提示access denied

机器是CentOS7.0

安装mysql

在mysql官网下载mysql-community-release-el7-5.noarch.rpm

rpm -ivh mysql-community-release-el7-5.noarch.rpm

yum install mysql-community-server

过程如下:

[root@localhost network-scripts]# cd /root/Desktop/

[root@localhost Desktop]# ls

mysql57-community-release-el7-7.noarch.rpm

[root@localhost Desktop]# rpm -ivh mysql57-community-release-el7-7.noarch.rpm

warning: mysql57-community-release-el7-7.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

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

Updating / installing...

1:mysql57-community-release-el7-7 ################################# [100%]

[root@localhost Desktop]# yum install mysql-community-release

Loaded plugins: fastestmirror, langpacks

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

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

The other application is: PackageKit

Memory : 102 M RSS (432 MB VSZ)

Started: Tue Jan 26 21:04:26 2016 - 05:40 ago

State : Sleeping, pid: 3326

^C

Exiting on user cancel.

[root@localhost Desktop]# yum install mysql-community-server

Loaded plugins: fastestmirror, langpacks

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

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

The other application is: PackageKit

Memory : 102 M RSS (432 MB VSZ)

Started: Tue Jan 26 21:04:26 2016 - 05:47 ago

State : Sleeping, pid: 3326

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

The other application is: PackageKit

Memory : 102 M RSS (432 MB VSZ)

Started: Tue Jan 26 21:04:26 2016 - 05:49 ago

State : Sleeping, pid: 3326

^C

Exiting on user cancel.

[root@localhost Desktop]# kill 3326

[root@localhost Desktop]# yum install mysql-community-server

Loaded plugins: fastestmirror, langpacks

base | 3.6 kB 00:00

extras | 3.4 kB 00:00

mysql-connectors-community | 2.5 kB 00:00

mysql-tools-community | 2.5 kB 00:00

mysql57-community | 2.5 kB 00:00

updates | 3.4 kB 00:00

(1/4): mysql-connectors-community/x86_64/primary_db | 8.6 kB 00:00

(2/4): updates/7/x86_64/primary_db | 2.3 MB 00:00

(3/4): mysql57-community/x86_64/primary_db | 28 kB 00:00

(4/4): mysql-tools-community/x86_64/primary_db | 24 kB 00:00

Loading mirror speeds from cached hostfile

* base: mirrors.zju.edu.cn

* extras: mirrors.zju.edu.cn

* updates: mirrors.zju.edu.cn

Resolving Dependencies

--> Running transaction check

---> Package mysql-community-server.x86_64 0:5.7.10-1.el7 will be installed

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

--> Processing Dependency: mysql-community-client(x86-64) = 5.7.10-1.el7 for package: mysql-community-server-5.7.10-1.el7.x86_64

--> Running transaction check

---> Package mysql-community-client.x86_64 0:5.7.10-1.el7 will be installed

--> Processing Dependency: mysql-community-libs(x86-64) = 5.7.10-1.el7 for package: mysql-community-client-5.7.10-1.el7.x86_64

---> Package mysql-community-common.x86_64 0:5.7.10-1.el7 will be installed

--> Running transaction check

---> Package mariadb-libs.x86_64 1:5.5.35-3.el7 will be obsoleted

--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64

--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64

---> Package mysql-community-libs.x86_64 0:5.7.10-1.el7 will be obsoleting

--> Running transaction check

---> Package mysql-community-libs-compat.x86_64 0:5.7.10-1.el7 will be obsoleting

--> Finished Dependency Resolution

Dependencies Resolved

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

Package Arch Version Repository Size

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

Installing:

mysql-community-libs x86_64 5.7.10-1.el7 mysql57-community 2.2 M

replacing mariadb-libs.x86_64 1:5.5.35-3.el7

mysql-community-libs-compat x86_64 5.7.10-1.el7 mysql57-community 2.0 M

replacing mariadb-libs.x86_64 1:5.5.35-3.el7

mysql-community-server x86_64 5.7.10-1.el7 mysql57-community 142 M

Installing for dependencies:

mysql-community-client x86_64 5.7.10-1.el7 mysql57-community 24 M

mysql-community-common x86_64 5.7.10-1.el7 mysql57-community 269 k

Transaction Summary

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

Install 3 Packages (+2 Dependent packages)

Total download size: 171 M

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

Downloading packages:

warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.10-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Public key for mysql-community-common-5.7.10-1.el7.x86_64.rpm is not installed

(1/5): mysql-community-common-5.7.10-1.el7.x86_64.rpm | 269 kB 00:07

(2/5): mysql-community-libs-5.7.10-1.el7.x86_64.rpm | 2.2 MB 00:20

(3/5): mysql-community-libs-compat-5.7.10-1.el7.x86_64.rpm | 2.0 MB 00:15

(4/5): mysql-community-client-5.7.10-1.el7.x86_64.rpm | 24 MB 03:06

(5/5): mysql-community-server-5.7.10-1.el7.x86_64.rpm | 142 MB 20:39

--------------------------------------------------------------------------------

Total 136 kB/s | 171 MB 21:23

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

Importing GPG key 0x5072E1F5:

Userid : "MySQL Release Engineering "

Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5

Package : mysql57-community-release-el7-7.noarch (installed)

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

Is this ok [y/N]: y

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

Warning: RPMDB altered outside of yum.

Installing : mysql-community-common-5.7.10-1.el7.x86_64 1/6

Installing : mysql-community-libs-5.7.10-1.el7.x86_64 2/6

Installing : mysql-community-client-5.7.10-1.el7.x86_64 3/6

Installing : mysql-community-server-5.7.10-1.el7.x86_64 4/6

Installing : mysql-community-libs-compat-5.7.10-1.el7.x86_64 5/6

Erasing : 1:mariadb-libs-5.5.35-3.el7.x86_64 6/6

Verifying : mysql-community-server-5.7.10-1.el7.x86_64 1/6

Verifying : mysql-community-libs-compat-5.7.10-1.el7.x86_64 2/6

Verifying : mysql-community-common-5.7.10-1.el7.x86_64 3/6

Verifying : mysql-community-libs-5.7.10-1.el7.x86_64 4/6

Verifying : mysql-community-client-5.7.10-1.el7.x86_64 5/6

Verifying : 1:mariadb-libs-5.5.35-3.el7.x86_64 6/6

Installed:

mysql-community-libs.x86_64 0:5.7.10-1.el7

mysql-community-libs-compat.x86_64 0:5.7.10-1.el7

mysql-community-server.x86_64 0:5.7.10-1.el7

Dependency Installed:

mysql-community-client.x86_64 0:5.7.10-1.el7

mysql-community-common.x86_64 0:5.7.10-1.el7

Replaced:

mariadb-libs.x86_64 1:5.5.35-3.el7

Complete!

启动mysql服务

service mysqld start

mysql

037c8a0fdfbf82832c630501c25461c3.png

找了网上的教程,在my.cnf中加入 user=mysql也不行

如何才能进入mysql

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值