使用rpm安装MySQL-client-5.5.48-1.linux2.6.i386.rpm、MySQL-server-5.5.48-1.linux2.6.i386.rpm
直接安装会出现以下缺少依赖的问题
[root@test01 opt]# rpm -ivh MySQL-server-5.5.48-1.linux2.6.i386.rpm
warning: MySQL-server-5.5.48-1.linux2.6.i386.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
libaio.so.1 is needed by MySQL-server-5.5.48-1.linux2.6.i386
libaio.so.1(LIBAIO_0.1) is needed by MySQL-server-5.5.48-1.linux2.6.i386
libaio.so.1(LIBAIO_0.4) is needed by MySQL-server-5.5.48-1.linux2.6.i386
[root@test01 opt]# rpm -ivh MySQL-client-5.5.48-1.linux2.6.i386.rpm
warning: MySQL-client-5.5.48-1.linux2.6.i386.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
libncurses.so.5 is needed by MySQL-client-5.5.48-1.linux2.6.i386
查找是否有依赖(已经将
libaio-0.3.107-10.el6.x86_64.rpm
这个包下载好了和mysql的rpm包放在同一个目录下)
[root@test01 opt]# find -name libaio*
./libaio-0.3.107-10.el6.x86_64.rpm
#若存在其他的直接移除
[root@test01 opt]# yum -y remove libaio-0.3.107-10.el6.x86_64.rpm
此时如果报这个错,说明需要修改yum的配置文件
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
[root@test01 opt]#vim /etc/yum.repos.d/CentOS-Base.repo
#将原配置中的mirrorlist添加注释,并把baseurl删去注释–以base为例,其他的做同样修改
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#而baseurl链接http://mirror.centos.org/centos/已经没有资源了,重新配置资源路径https://vault.centos.org/6.8/
#修改后的配置
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=https://vault.centos.org/6.8/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
baseurl=https://vault.centos.org/6.8/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=https://vault.centos.org/6.8/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
baseurl=https://vault.centos.org/6.8/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra
baseurl=https://vault.centos.org/6.8/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
yum配置完后,根据安装mysql报的错,进行依赖的安装
[root@test01 opt]# yum install libaio.so.1
[root@test01 opt]# yum install libncurses.so.5
安装完毕后再次安装mysql即可
[root@test01 opt]# rpm -ivh MySQL-server-5.5.48-1.linux2.6.i386.rpm
warning: MySQL-server-5.5.48-1.linux2.6.i386.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
210826 3:35:32 [Note] /usr/sbin/mysqld (mysqld 5.5.48) starting as process 33397 ...
210826 3:35:32 [Note] /usr/sbin/mysqld (mysqld 5.5.48) starting as process 33404 ...
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h test01 password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
Please report any problems at http://bugs.mysql.com/
[root@test01 opt]# rpm -ivh MySQL-client-5.5.48-1.linux2.6.i386.rpm
warning: MySQL-client-5.5.48-1.linux2.6.i386.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]
参考博文:https://blog.csdn.net/weixin_44343282/article/details/113544092;
https://blog.csdn.net/sjgllllll/article/details/119273291
如果需要,附上libaio-0.3.107-10.el6.x86_64.rpm的包
链接:https://pan.baidu.com/s/11bEBuoLVokPWiSDZ6Tv97g
提取码:5l6r