zoukankan      html  css  js  c++  java
  • centos7 安装mysql8

    1、安装yum 源 
    参考官方:https://dev.mysql.com/downloads/repo/yum/

    rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm

    2、安装

    yum -y install mysql-community-server

    3、mysql8安装的时候会生成个临时的密码,通过如下命令查看

    grep "A temporary password" /var/log/mysqld.log

    4、进入数据库,修改root密码

    mysql -uroot -p

    输入密码进入数据库 


    修改密码复杂度

    mysql> set global validate_password.policy=0;
    mysql> set global validate_password.length=1;

    修改密码

    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码'; 
    FLUSH PRIVILEGES; 

    查看版本号

    mysql> status;

    mysql8.0远程连接权限设置

    1.登录MySQL
    mysql -u root -p

    2.选择 mysql 数据库

    use mysql;

    因为 mysql 数据库中存储了用户信息的 user 表。

    3.在 mysql 数据库的 user 表中查看当前 root 用户的相关信息
    select host, user, authentication_string, plugin from user;

    查看表格中 root 用户的 host,默认应该显示的 localhost,只支持本地访问,不允许远程访问。
     
    我们看host和user两列,host和user中root对应的值为localhost,即root用户的访问权限为localhost,想把该用户的访问权限设置可远程连接,我们只需要把localhost更改为通配的%就可以了。上面的权限操作语句没有走通,这里就直接使用update语句来更改吧。
    update user set host = "%" where user = "root";
    FLUSH PRIVILEGES;

    参考:

    https://blog.csdn.net/guyan0319/article/details/80374701 
    http://blog.sina.com.cn/s/blog_1645e034e0102ydlz.html

    https://blog.csdn.net/weixin_40517703/article/details/83030231

  • 相关阅读:
    《大型网站技术架构》学习笔记——架构演化
    ASP.NET MVC之Html.RenderAction
    设计模式学习笔记——面向对象设计原则
    设计模式学习笔记——类图
    观察者模式
    泛型接口
    泛型的实例化应用
    多线程第二种方式-实现runnable
    对象中的某个属性不希望被序例化--transient
    对象序例化
  • 原文地址:https://www.cnblogs.com/xiaoyou2018/p/11242604.html
Copyright © 2011-2022 走看看