安装mysql

命令1:wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
命令2:rpm -ivh mysql57-community-release-el7-8.noarch.rpm

vim /etc/my.cnf

命令3:yum -y install mysql-server

日志:
[root@aliyun-xg-1 ~]# cd /usr/local/software/mysql
[root@aliyun-xg-1 mysql]# ll
total 0
[root@aliyun-xg-1 mysql]# wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
--2019-04-02 13:22:51-- http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
Resolving repo.mysql.com (repo.mysql.com)... 23.56.181.34
Connecting to repo.mysql.com (repo.mysql.com)|23.56.181.34|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9116 (8.9K) [application/x-redhat-package-manager]
Saving to: ‘mysql57-community-release-el7-8.noarch.rpm’

100%[===============================================================================================================================================================================================>] 9,116 --.-K/s in 0s

2019-04-02 13:22:51 (268 MB/s) - ‘mysql57-community-release-el7-8.noarch.rpm’ saved [9116/9116]

[root@aliyun-xg-1 mysql]# rpm -ivh mysql57-community-release-el7-8.noarch.rpm
warning: mysql57-community-release-el7-8.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql57-community-release-el7-8 ################################# [100%]
[root@aliyun-xg-1 mysql]# yum -y install mysql-server
Loaded plugins: fastestmirror
Determining fastest mirrors
base | 3.6 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 3.4 kB 00:00:00
mysql-connectors-community | 2.5 kB 00:00:00
mysql-tools-community | 2.5 kB 00:00:00
mysql57-community | 2.5 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/10): base/7/x86_64/group_gz | 166 kB 00:00:00
(2/10): epel/x86_64/updateinfo | 1.0 MB 00:00:00
(3/10): epel/x86_64/primary_db | 6.6 MB 00:00:00
(4/10): base/7/x86_64/primary_db | 6.0 MB 00:00:00
(5/10): epel/x86_64/group_gz | 88 kB 00:00:00
(6/10): extras/7/x86_64/primary_db | 187 kB 00:00:00
(7/10): mysql-connectors-community/x86_64/primary_db | 37 kB 00:00:00
(8/10): mysql-tools-community/x86_64/primary_db | 54 kB 00:00:00
(9/10): updates/7/x86_64/primary_db | 3.4 MB 00:00:00
(10/10): mysql57-community/x86_64/primary_db | 170 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.7.25-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.7.25-1.el7 for package: mysql-community-server-5.7.25-1.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.25-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: mysql-community-server-5.7.25-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: mysql-community-server-5.7.25-1.el7.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: mysql-community-server-5.7.25-1.el7.x86_64
--> Running transaction check
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
---> Package mysql-community-client.x86_64 0:5.7.25-1.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.25-1.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.7.25-1.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.60-1.el7_5 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.25-1.el7 will be obsoleting
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:5.7.25-1.el7 will be obsoleting
---> Package postfix.x86_64 2:2.10.1-6.el7 will be updated
---> Package postfix.x86_64 2:2.10.1-7.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================================================================================================
Installing:
mysql-community-libs x86_64 5.7.25-1.el7 mysql57-community 2.2 M
replacing mariadb-libs.x86_64 1:5.5.60-1.el7_5
mysql-community-libs-compat x86_64 5.7.25-1.el7 mysql57-community 2.0 M
replacing mariadb-libs.x86_64 1:5.5.60-1.el7_5
mysql-community-server x86_64 5.7.25-1.el7 mysql57-community 165 M
Installing for dependencies:
libaio x86_64 0.3.109-13.el7 base 24 k
mysql-community-client x86_64 5.7.25-1.el7 mysql57-community 24 M
mysql-community-common x86_64 5.7.25-1.el7 mysql57-community 274 k
Updating for dependencies:
postfix x86_64 2:2.10.1-7.el7 base 2.4 M

Transaction Summary
=========================================================================================================================================================================================================================================
Install 3 Packages (+3 Dependent packages)
Upgrade ( 1 Dependent package)

Total download size: 196 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/7): libaio-0.3.109-13.el7.x86_64.rpm | 24 kB 00:00:00
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.25-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Public key for mysql-community-common-5.7.25-1.el7.x86_64.rpm is not installed
(2/7): mysql-community-common-5.7.25-1.el7.x86_64.rpm | 274 kB 00:00:00
(3/7): mysql-community-libs-5.7.25-1.el7.x86_64.rpm | 2.2 MB 00:00:00
(4/7): mysql-community-libs-compat-5.7.25-1.el7.x86_64.rpm | 2.0 MB 00:00:00
(5/7): postfix-2.10.1-7.el7.x86_64.rpm | 2.4 MB 00:00:00
(6/7): mysql-community-client-5.7.25-1.el7.x86_64.rpm | 24 MB 00:00:02
(7/7): mysql-community-server-5.7.25-1.el7.x86_64.rpm | 165 MB 00:00:15
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 13 MB/s | 196 MB 00:00:15
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
Package : mysql57-community-release-el7-8.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : mysql-community-common-5.7.25-1.el7.x86_64 1/9
Installing : mysql-community-libs-5.7.25-1.el7.x86_64 2/9
Installing : mysql-community-libs-compat-5.7.25-1.el7.x86_64 3/9
Installing : mysql-community-client-5.7.25-1.el7.x86_64 4/9
Installing : libaio-0.3.109-13.el7.x86_64 5/9
Installing : mysql-community-server-5.7.25-1.el7.x86_64 6/9
Updating : 2:postfix-2.10.1-7.el7.x86_64 7/9
Cleanup : 2:postfix-2.10.1-6.el7.x86_64 8/9
Erasing : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 9/9
Verifying : mysql-community-libs-5.7.25-1.el7.x86_64 1/9
Verifying : mysql-community-libs-compat-5.7.25-1.el7.x86_64 2/9
Verifying : mysql-community-common-5.7.25-1.el7.x86_64 3/9
Verifying : 2:postfix-2.10.1-7.el7.x86_64 4/9
Verifying : mysql-community-server-5.7.25-1.el7.x86_64 5/9
Verifying : mysql-community-client-5.7.25-1.el7.x86_64 6/9
Verifying : libaio-0.3.109-13.el7.x86_64 7/9
Verifying : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 8/9
Verifying : 2:postfix-2.10.1-6.el7.x86_64 9/9

Installed:
mysql-community-libs.x86_64 0:5.7.25-1.el7 mysql-community-libs-compat.x86_64 0:5.7.25-1.el7 mysql-community-server.x86_64 0:5.7.25-1.el7

Dependency Installed:
libaio.x86_64 0:0.3.109-13.el7 mysql-community-client.x86_64 0:5.7.25-1.el7 mysql-community-common.x86_64 0:5.7.25-1.el7

Dependency Updated:
postfix.x86_64 2:2.10.1-7.el7

Replaced:
mariadb-libs.x86_64 1:5.5.60-1.el7_5

Complete!


service mysqld restart 启动mysql
grep "password" /var/log/mysqld.log 查询密码
mysql -u root -p
alter user 'root'@'localhost' identified by 'x3*Ww)tzg5q)'; 修改密码
use mysql;
update user set Host = '%' where User = 'root'; 修改访问权限
commit;

FLUSH PRIVILEGES;

转载于:https://www.cnblogs.com/ayong123/p/10642343.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值