centos7使用rpm安装mysql5.7的方法

王林
Lepaskan: 2023-05-27 08:05:53
ke hadapan
1529 人浏览过

1.下载 4个rpm包

mysql-community-client-5.7.26-1.el7.x86_64.rpm
mysql-community-common-5.7.26-1.el7.x86_64.rpm
mysql-community-libs-5.7.26-1.el7.x86_64.rpm
mysql-community-server-5.7.26-1.el7.x86_64.rpm
Salin selepas log masuk

想要用迅雷进行下载得先找到对应的rpm下载路径

首先浏览器打开mysql官网:

在打开的界面,按键盘 f12 打开开发者工具,打开后如下:

centos7使用rpm安装mysql5.7的方法

在官网找到对应的版本:

centos7使用rpm安装mysql5.7的方法

点击直接下载:

centos7使用rpm安装mysql5.7的方法

在开发者工具就能找到下载路径:

centos7使用rpm安装mysql5.7的方法

如下给出了4个myql5.7 的rpm包的路径,直接打开迅雷填入下载路径就可以进行下载,其他版本可以用同样方法:

https://cdn.mysql.com//downloads/mysql-5.7/mysql-community-server-5.7.26-1.el7.x86_64.rpm

https://cdn.mysql.com//downloads/mysql-5.7/mysql-community-client-5.7.26-1.el7.x86_64.rpm

https://cdn.mysql.com//downloads/mysql-5.7/mysql-community-common-5.7.26-1.el7.x86_64.rpm

https://cdn.mysql.com//downloads/mysql-5.7/mysql-community-libs-5.7.26-1.el7.x86_64.rpm

2.上传rpm到linux

我这里用的xshell,没有安装xftp

centos7使用rpm安装mysql5.7的方法

在sftp输入 put命令,选择下载好的rpm包即可上传:

centos7使用rpm安装mysql5.7的方法

3.安装

已经上传好的rpm如下:

centos7使用rpm安装mysql5.7的方法

通过 rpm -ivhmysql-community-****-5.7.26-1.el7.x86_64.rpm--force --nodeps 进行安装,***表示common 、libs、client、server

安装顺序 common-->libs-->client-->server

如果没有--force --nodeps会出现告警:

  warning: mysql-community-common-5.7.26-1.el7.x86_64.rpm: header v3 dsa/sha1 signature, key id 5072e1f5: nokey

4.配置

启动mysql服务 :

[root@localhost ~]# service mysqld start
redirecting to /bin/systemctl start mysqld.service
[root@localhost ~]#
Salin selepas log masuk

找到初始密码:

[root@localhost ~]# cat /var/log/mysqld.log |grep password
2019-06-02t08:39:38.448115z 1 [note] a temporary password is generated for root@localhost: dlzmcrv?s2q)
2019-06-02t08:40:41.870130z 2 [note] access denied for user 'root'@'localhost' (using password: no)
Salin selepas log masuk

登陆mysql:

[root@localhost ~]# mysql -u root -p

密码为上面找到的dlzmcrv?s2q)

修改root密码:

mysql> alter user 'root'@'localhost' identified by 'newpasswd';

允许远程连接:

mysql> grant all privileges on *.* to 'root'@'%' identified by 'newpasswd' with grant option;
mysql> flush peivleges;
Salin selepas log masuk

关闭防火墙:

[root@localhost ~]# systemctl stop firewalld.service

以上是centos7使用rpm安装mysql5.7的方法的详细内容。更多信息请关注PHP中文网其他相关文章!

Label berkaitan:
sumber:yisu.com
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan
Tentang kita Penafian Sitemap
Laman web PHP Cina:Latihan PHP dalam talian kebajikan awam,Bantu pelajar PHP berkembang dengan cepat!