CentOS7不能yum解决方法
CentOS7,系统装好之后,不能yum。
报出来的信息如下:
------------------------------------------------------------------------------------------------------------------------
You have enabled checking of packages via GPG keys This is a good thing
However, you do not have any GPG public keys installed You need to download
the keys for packages you wish to install and install them
You can do that by running the command:
rpm --import publicgpgkey
Alternatively you can specify the url to the key you would like to use
for a repository in the 'gpgkey' option in a repository section and yum
will install it for you
For more information contact your distribution or package provider
------------------------------------------------------------------------------------------------------------------------
解决方案
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
本文为大家分享了centos7利用yum安装mysql
8012的详细步骤,供大家参考,具体内容如下
清理原有的mysql
rpm
-qa
|
grep
mysql
#可能的显示情况如下
#mysql-community-libs-8012-1el7x86_64
#mysql80-community-release-el7-1noarch
#mysql-community-client-8012-1el7x86_64
#mysql-community-common-8012-1el7x86_64
#mysql-community-server-8012-1el7x86_64
#通过下面的命令进行删除
yum
remove
mysql-xxx-xxx-
#查找mysql的相关文件
find
/
-name
mysql
#根据自身的需求删除mysql的配置文件信息
rm
-rf
/var/lib/mysql
删除CentOS7默认的数据库mariadb
rpm
-qa
|
grep
mariadb
#查找mariadb
#可能出现的结果mariadb-libs-5556-2el7x86_64
#将查找出来的结果进行强制删除
rpm
-e
--nodeps
mariadb-libs-5556-2el7x86_64
下载mysql
yum源
mysql
yum源下载地址
点击download进入下载页面
鼠标悬浮在
“No
thanks,
just
start
my
download”可查看mysql
yum源的地址,选中右键复制链接地址进行下载
cd
/usr/src
wget
https://devmysqlcom/get/mysql80-community-release-el7-1noarchrpm
#安装yum源
yum
localinstall
mysql80-community-release-el7-1noarchrpm
#更新yum源
yum
clean
all
yum
makecache
#开始安装MySQL
yum
install
mysql-community-server
#启动MySQL
systemctl
start
mysqld
#启动成功后可以查看初始化密码随机生成的
cat
/var/log/mysqldlog
|
grep
password
#登录MySQL修改mysql用户密码
mysql
-u
root
-p
mysql>
ALTER
USER
'root'@'localhost'
IDENTIFIED
BY
'yourpassword';
#远程设置
mysql>
use
mysql;
mysql>
update
user
set
host='%'
where
user='root';
#授权用户名的权限,赋予任何主机访问数据的权限
mysql>
GRANT
ALL
PRIVILEGES
ON
TO
'root'@'%'WITH
GRANT
OPTION;
mysql>
FLUSH
PRIVILEGES;
其他的几种mysql用户权限的设置方法
#允许myuser用户使用mypassword密码从任何主机连接到mysql服务器
GRANT
ALL
PRIVILEGES
ON
TO
'myuser'@'%'IDENTIFIED
BY
'mypassword'
WITH
GRANT
OPTION;
#允许用户myuser从ip为19216816的主机连接到mysql服务器,并使用mypassword作为密码
GRANT
ALL
PRIVILEGES
ON
TO
'myuser'@'19216813'IDENTIFIED
BY
'mypassword'
WITH
GRANT
OPTION;
数据库的相关操作
#启动mysql
systemctl
start
mysqldservice
#结束
systemctl
stop
mysqldservice
#重启
systemctl
restart
mysqldservice
#开机自启
systemctl
enable
mysqldservice
mysql登录用户密码设置好后,需要开发安全组端口
端口开放后就可以进行数据库连接操作了,在使用Navicat
for
MySQL
连接
Mysql
8012可能会出现问题
Client
does
not
support
authentication
protocol
错误解决方法
#修改加密规则
(这行我没有写,不过貌似也可以)密码需要设置包含大小写字母符号和数字的格式,否则设置不会超成功
ALTER
USER
'root'@'%'
IDENTIFIED
BY
'password'
PASSWORD
EXPIRE
NEVER;
#更新一下用户的密码
ALTER
USER
'root'@'%'
IDENTIFIED
WITH
mysql_native_password
BY
'password';
#刷新权限
FLUSH
PRIVILEGES;
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
您可能感兴趣的文章:mysql
8012
安装配置方法并修改密码mysql
community
server
8012安装配置方法图文教程mysql
8012
winx64详细安装教程mysql
8012
解压版安装教程mysql
8012
解压版安装教程
个人亲测!mysql
installer
community
80120安装图文教程mysql
8012
安装配置方法图文教程(windows10)mysql
8012
安装使用教程mysql
8012
简单安装教程mysql
8012
安装配置图文教程mysql
8012
快速安装教程mysql
8012
安装配置方法图文教程Windows10下mysql
8012解压版安装配置方法图文教程mysql
8012
winx64解压版安装图文教程mysql
8012
winx64下载安装教程
1、获取并安装zabbix的yum源
[root@localhost ~]#wget http://repozabbixcom/zabbix/32/rhel/7/x86_64/zabbix-release-32-1el7noarchrpm
[root@localhost ~]#rpm -ivh http://repozabbixcom/zabbix/32/rhel/7/x86_64/zabbix-release-32-1el7noarchrpm
2、生成yum源快照,这样可以直接用tab键来补全安装。
yum makecache
3、查看文件:
[root@localhost ~]# yum search zabbix
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
base: ftpsjtueducn
extras: ftpsjtueducn
updates: ftpsjtueducn
Yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及CentOS中的Shell前端软件包管理器。基于RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,无须繁琐地一次次下载、安装。
0条评论