there are two ways to install mysql client on centOS.
1. First method (download rpm package)
download rpm package from mysql website https://downloads.mysql.com/archives/community/
if you download this rpm package like picture, it's filename like mysql-community-client-8.0.21-1.el8.x86_64.rpm.
then execute sudo rpm -ivh --nodeps --force mysql-community-client-8.0.21-1.el8.x86_64.rpm
can install the rpm package the parameters -ivh
means install, print output, don't verify and check.
if raise error, maybe version conflict, you can execute rpm -pa | grep mysql
to find conflicting package, then execute rpm -e --nodeps <package name>
to remove them, and install once more.
finnaly, you can execute which mysql
, it's success if print /usr/bin/mysql.
2.Second method (Set repo of yum)
Please refer to this official website:
MySQL Yum Repository
A Quick Guide to Using the MySQL Yum Repository
yum
= RedHat / CentOS andapt
= Debian / Ubuntu). So I have an edit to make the question more "Q-and-A-like" in the review queue that I would appreciate if someone could approve. – Shell