标签:cli class hat shel available centos host 命令 centos7安装
在centos?6安装?mysql-server是直接使用命令?yum?-y?install?mysql-server?,但是在CentOS?7中出现了?No?package?mysql-server?available.?Error:?Nothing?to?do?错误。详细错误信息如下:
[root@laona?~]#?yum?-y?install?mysql-server
Loaded?plugins:?fastestmirror
Repository?base?is?listed?more?than?once?in?the?configuration
Repository?updates?is?listed?more?than?once?in?the?configuration
Repository?extras?is?listed?more?than?once?in?the?configuration
Repository?centosplus?is?listed?more?than?once?in?the?configuration
Repository?contrib?is?listed?more?than?once?in?the?configuration
Loading?mirror?speeds?from?cached?hostfile
?*?base:?mirrors.cloud.aliyuncs.com
?*?extras:?mirrors.cloud.aliyuncs.com
?*?updates:?mirrors.cloud.aliyuncs.com
No?package?mysql-server?available.
Error:?Nothing?to?do
使用?MariaDB?代替?MySQL?命令即可
简单来说,MariaDB?是?MySQL?的fork,两者关系就好比?Red?Hat?和?CentOS?的关系。从?MySQL?变成了?Oracle?甲骨文公司的产品后,MySQL?就已经从?RHEL?和?CentOS?所提供的套件清单移除了。
sudo?yum?-y?install?mariadb?mariasb-client
sudo?systemctl?start?mariadb
sudo?systemctl?enable?mariadb
sudo?systemctl?status?mariadb
sudo?mysql_secure_installation
这个shell主要是有以下作用:
-?设定?root?账号的密码
-?禁止?root?丛非本人登录
-?移除?anonymous?匿名用户登录
-?移除测试数据库
mysql?-v
键入以下指令,输入密码即可。
mysql?-u?root?-h?localhost?-p
CentOS 7中安装 MySQL 出现了 No package mysql-server available. Error: Nothing to do 错误
标签:cli class hat shel available centos host 命令 centos7安装
原文地址:https://www.cnblogs.com/huaiangg/p/12355069.html