• 欢迎访问VPS岛网站,国外VPS,国内VPS,国外服务器,国内服务器,服务器主机,测评及优惠码,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站 QQ群

mysql

mysql技术 天谕square 22次浏览 已收录 0个评论

rpm -ivh mysql-community-client-plugins-8.0.22-1.el7.x86_64.rpm
rpm -ivh mysql-community-common-8.0.22-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.22-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-8.0.22-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.22-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.22-1.el7.x86_64.rpm

tX8dmPRW>x2z

ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘LXYtql3.25’;

ALTER USER ‘mysql.infoschema’@’localhost’ IDENTIFIED BY ‘LXYtql3.25’;

ALTER USER ‘mysql.session’@’localhost’ IDENTIFIED BY ‘LXYtql3.25’;

ALTER USER ‘mysql.sys’@’localhost’ IDENTIFIED BY ‘LXYtql3.25’;

(1) yum list installed |grep mariadb 查看是否安装Mariadb服务
yum -y remove mariadb 删除Mariadb服务
(2) yum list installed |grep mysql 查看是否安装MySQL
yum -y remove mysql 删除MySQL
(3)删除依赖包
rpm -qa |grep mariadb
rpm -e –nodeps mariadb-libs-5.5.56-2.el7.x86_64
rpm -qa |grep mysql
rpm -e –nodeps qt-mysql-4.8.7-2.el7.x86_64
rpm -e –nodeps libdbi-dbd-mysql-0.8.3-16.el7.x86_64
(4)删除MySQL和mariadb相关文件夹
find / -name mariadb
find / -name mysql
(5)添加MySQL组
groupadd mysql
(6)创建MySQL用户并指定到MySQL用户所在的组
useradd -g mysql mysql
(7)给MySQL用户添加密码
passwd mysql
下载并添加存储库
sudo yum -y localinstall https://dev/mysql.com/get/mysql80-community-release-el7-2.noarch.rpm
依次安装MySQL8.0包
rpm -ivh mysql-community-client-plugins-8.0.22-1.el7.x86_64.rpm
rpm -ivh mysql-community-common-8.0.22-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.22-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-8.0.22-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.22-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.22-1.el7.x86_64.rpm
编辑MySQL配置文件
vi /etc/my.cnf
defualt-authentication-plugin=mysql_native_password
启动服务
ststemctl start mysqld
查看服务
systemctl status mysqld
查询root临时密码
sudo grep ‘temporary password’ /var/log/mysqld.logroot@localhost:******-*****
br/>root@localhost:******-*****<br/
登录数据库更改root密码
mysql -uroot -p
ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘LXYtql3.25’;
ALTER USER ‘mysql.infoschema’@’localhost’ IDENTIFIED BY ‘LXYtql3.25’;
ALTER USER ‘mysql.session’@’localhost’ IDENTIFIED BY ‘LXYtql3.25’;
ALTER USER ‘mysql.sys’@’localhost’ IDENTIFIED BY ‘LXYtql3.25’;
use mysql;
select user,pulgin,authentication_string,password_last_changed from user;
flush privileges;
quit;


VPS岛 的文章和资源来自互联网,仅作为参考资料,如果有侵犯版权的资源请尽快联系站长,我们会在24h内删除有争议的资源。丨 转载请注明mysql
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址