我正在尝试在 Amazon Linux 2 上安装 mysql。我按照这里第一个答案中的说明进行操作:
amazon linux 2 ami - aws - 如何在 Amazon Linux 2 中安装 mysql?
当我输入:
sudo yum install mysql-community-server
我得到:
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core | 2.4 kB 00:00:00
amzn2extra-docker | 1.3 kB 00:00:00
http://repo.mysql.com/yum/mysql-connectors-community/fc/2/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
One of the configured repositories failed (MySQL Connectors Community),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=mysql-connectors-community ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable mysql-connectors-community
or
subscription-manager repos --disable=mysql-connectors-community
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=mysql-connectors-community.skip_if_unavailable=true
failure: repodata/repomd.xml from mysql-connectors-community: [Errno 256] No more mirrors to try.
http://repo.mysql.com/yum/mysql-connectors-community/fc/2/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
那么,出现了 404 错误。我该如何解决这个问题?
答案1
您链接的答案是错误的,尽管它在发布时可能意外地起作用了。
MySQL 不提供适用于 Amazon Linux(1 或 2)的 RPM。该答案中给出的说明适用于 CentOS 7,并且仅适用于 RHEL 7、CentOS 7 或实际相同的克隆(Oracle、Scientific 等)。Amazon Linux 和 Amazon Linux 2 是不是保证与 CentOS 软件包兼容,或者实际上与任何其他发行版的软件包兼容。
如果您需要使用这样的软件包,您还需要切换您的 Linux 发行版。
答案2
Michael Hampton 是正确的,请参考支持的平台https://www.mysql.com/support/supportedplatforms/database.html,如果你还想尝试检查http://repo.mysql.com/yum/mysql-connectors-community/fc/这是索引的 mysql repo,并为您的 repo 找到适当的连接器 url。