shell[root@marshal05 software]# yum -y install mysql57-community-release-el7-10.noarch.rpm
Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.bfsu.edu.cn * extras: mirrors.bfsu.edu.cn * updates: mirrors.bfsu.edu.cnbase | 3.6 kB 00:00:00 extras | 2.9 kB 00:00:00 updates | 2.9 kB 00:00:00 No package mysql57-community-release-el7-10.noarch.rpm available.Error: Nothing to do
shellwget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
shellyum -y install mysql57-community-release-el7-10.noarch.rpm
shellyum -y install mysql-community-server
shellwarning: /var/cache/yum/x86_64/2.1903/mysql57-community/packages/mysql-community-libs-compat-5.7.37-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql The GPG keys listed for the "MySQL 5.7 Community Server" repository are already installed but they are not correct for this package. Check that the correct key URLs are configured for this repository. Failing package is: mysql-community-libs-compat-5.7.37-1.el7.x86_64 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
大致意思就是MySQL的GPG升级了,需要更新,如果是新安装的MySQL,执行以下脚本即可:
shellrpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
然后再进行安装就好了
shellsystemctl start mysqld.service
shellsystemctl status mysqld.service
shellgrep "password" /var/log/mysqld.log
shellmysql -uroot -p
shellALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
其中'new password'替换成你要设置的密码,注意:密码设置必须要大小写字母数字和特殊符号(,/';:等),不然不能配置成功。
执行以下命令开启远程访问限制(注意:下面命令开启的IP是 192.168.19.128,如要开启所有的,用%代替IP):
shellgrant all privileges on *.* to 'root'@'192.168.0.1' identified by 'password' with grant option; flush privileges;
https://img.php.cn/upload/article/000/000/020/1c5e17ddef9c7c75af5ff6c96182ab64-14.png
本文作者:chenchuan
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!