zoukankan      html  css  js  c++  java
  • MYSQL权限管理

    昨天刚刚安装了MYSQL,玩着挺Happy的,今天就链接不上了,报错是:

    root用户没有权限

    翻阅了一些文章,看着不太方便,我简单归纳一下:

    一、添加账户

    账户是:test;密码是:123456

    insert into mysql.user(Host,User,Password,ssl_cipher,x509_issuer,x509_subject) values("localhost","test",password("123456"),'','',''); 

    登录成功之后,发现没有目标数据库的权限,接下来:

    二、赋给权限

    grant all privileges on mydays.* to test@192.168.1.102 identified by '1234';

    三、重新登录

    mysql -h192.168.1.102 -utest -p'1234'

    结果:

    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    
    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mydays             |
    | test               |
    +--------------------+
    3 rows in set (0.01 sec)
  • 相关阅读:
    JUC学习
    java反射学习
    JSON入门学习
    redis
    NoSQ学习
    手写Lockl锁
    MapReduce过程
    scala学习
    idea jetty 配置
    java 基础--理论知识
  • 原文地址:https://www.cnblogs.com/liqiu/p/3917890.html
Copyright © 2011-2022 走看看