[root@iZx068ismxxjaoZ src]# yum repolist all | grep mysql mysql-cluster-7.5-community/x86_64 MySQL Cluster 7.5 Community disabled mysql-cluster-7.5-community-source MySQL Cluster 7.5 Community - disabled mysql-cluster-7.6-community/x86_64 MySQL Cluster 7.6 Community disabled mysql-cluster-7.6-community-source MySQL Cluster 7.6 Community - disabled mysql-cluster-8.0-community/x86_64 MySQL Cluster 8.0 Community disabled mysql-cluster-8.0-community-source MySQL Cluster 8.0 Community - disabled mysql-connectors-community/x86_64 MySQL Connectors Community enabled: 175 mysql-connectors-community-source MySQL Connectors Community - disabled mysql-tools-community/x86_64 MySQL Tools Community enabled: 120 mysql-tools-community-source MySQL Tools Community - Sourc disabled mysql-tools-preview/x86_64 MySQL Tools Preview disabled mysql-tools-preview-source MySQL Tools Preview - Source disabled mysql55-community/x86_64 MySQL 5.5 Community Server disabled mysql55-community-source MySQL 5.5 Community Server - disabled mysql56-community/x86_64 MySQL 5.6 Community Server disabled mysql56-community-source MySQL 5.6 Community Server - disabled mysql57-community/x86_64 MySQL 5.7 Community Server disabled mysql57-community-source MySQL 5.7 Community Server - disabled mysql80-community/x86_64 MySQL 8.0 Community Server enabled: 211 mysql80-community-source MySQL 8.0 Community Server - disabled
修改 mysql yum 仓库 默认配置
我选择安装 5.7 的版本 所以这里根据官方说明 禁掉 8.0 开启 5.7
1 2
[root@iZx068ismxxjaoZ src]# sudo yum-config-manager --disable mysql80-community sudo: yum-config-manager: command not found
[root@iZx068ismxxjaoZ src]# yum repolist enabled | grep mysql mysql-connectors-community/x86_64 MySQL Connectors Community 175 mysql-tools-community/x86_64 MySQL Tools Community 120 mysql57-community/x86_64 MySQL 5.7 Community Server 464
mysql> status; -------------- mysql Ver 14.14 Distrib 5.7.32, for Linux (x86_64) using EditLine wrapper
Connection id: 15 Current database: Current user: root@localhost SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 5.7.32 MySQL Community Server (GPL) Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: latin1 Db characterset: latin1 Client characterset: utf8 Conn. characterset: utf8 UNIX socket: /var/lib/mysql/mysql.sock Uptime: 38 min 44 sec
Threads: 2 Questions: 18 Slow queries: 0 Opens: 114 Flush tables: 1 Open tables: 107 Queries per second avg: 0.007 --------------
mysql>
修改字符集
停止 mysql :systemctl stop mysqld.service
编辑文件:vim /etc/my.cnf 加入四行
保存 my.cnf 后重启 MySQL :systemctl start mysqld.service