User-Profile-Image
hankin
  • 5
  • centos7
  • docker
  • mysql
  • PostgreSQL
  • git/gitlab
  • ELK
  • python
    • python-Tornado
    • python-django
  • redis
  • nginx
  • kvm
  • proxmox
  • mongo
  • kubernetes
  • prometheus
  • GlusterFs
  • nfs
  • freeswitch
  • httpd
  • shell脚本
  • linux
  • fastdfs
  • nextcloud
  • openssl
  • openvpn
  • rabbitmq
  • sqlite
  • svn
  • java
  • ubuntu
  • vue2
  • wordpress
  • php
  • IOT物联网
  • 项目
  • 故障处理
  • 树莓派
  • 博客存档
  • 未分类
  • 杂项
  • #1742(无标题)
  • 新视野
  • 分类
    • 项目
    • 树莓派
    • 杂项
    • 未分类
    • 新视野
    • 故障处理
    • 博客存档
    • wordpress
    • vue2
    • ubuntu
    • svn
    • sqlite
    • shell脚本
    • redis
    • rabbitmq
    • python-django
    • python
    • proxmox
    • prometheus
    • PostgreSQL
    • php
    • openvpn
    • openssl
    • nginx
    • nfs
    • nextcloud
    • mysql
    • mongo
    • linux
    • kvm
    • kubernetes
    • java
    • IOT物联网
    • httpd
    • GlusterFs
    • git/gitlab
    • freeswitch
    • fastdfs
    • ELK
    • docker
    • centos7
  • 页面
    • #1742(无标题)
  • 友链
      请到[后台->主题设置->友情链接]中设置。
Help?

Please contact us on our email for need any support

Support
    首页   ›   mysql   ›   正文
mysql

centos7yum安装mysql5.7.x

2022-11-25 23:36:47
1788  1 0

在centos7.9使用yum安装mysql5.7.x

安装yum管理包
yum -y install yum-utils
获取安装mysql源
wget https://repo.mysql.com//mysql80-community-release-el7-7.noarch.rpm
rpm -ivh mysql80-community-release-el7-7.noarch.rpm
导入公钥
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
停用mysql8源
yum-config-manager --disable mysql80-community

启用mysql5源

yum-config-manager --enable mysql57-community

安装mysql server和cli

yum install -y mysql-community-server  mysql

启动并加入自启

systemctl start mysqld
systemctl enable mysqld
systemctl status mysqld
查看初始密码
grep "A temporary password" /var/log/mysqld.log
修改root密码
mysql -u root -p
    在mysql客户端中执行:
    ALTER USER 'root'@'localhost' IDENTIFIED WITH MYSQL_NATIVE_PASSWORD BY 'xx';    
    flush privileges;
创建一个数据库
create database test1
创建库用户test-并给它test1库最高权限
create user 'test'@'localhost' identified by 'xx';
GRANT ALL ON test1.* TO 'test'@'localhost';
flush privileges;
连接测试
mysql -u test -p
评论 (1)

点击这里取消回复。

欢迎您 游客  

  • 感谢

    2年前
    回复
Copyright © 2025 网站备案号 : 蜀ICP备2022017747号
smarty_hankin 主题. Designed by hankin
主页
页面
  • #1742(无标题)
博主
tang.show
tang.show 管理员
linux、centos、docker 、k8s、mysql等技术相关的总结文档
210 文章 2 评论 201256 浏览
测试
测试