zoukankan      html  css  js  c++  java
  • mysql 添加新用户 赋予权限

    mysql -uroot -p

    输入密码;

    显示所有数据库

    show databases;

    选择库mysql

    use mysql; 

    查看所有用户

    select * from userG;

    创建新用户

    grant all privileges on *.* to '用户名'@'可登录主机' identified by '密码' with grant option;

    grant all privileges on *.* to 'test'@'%' identified by 'root' with grant option;

    赋予新用户权限:

    grant select,insert,update,delete on *.* to '用户名'@'可登录主机' identified by "密码";

    例:

    grant select,insert,update,delete on *.* to 'test'@'%' identified by "root";

    刷新权限表

    flush privileges;

    查看所有用户

    select * from userG;

    Host:标识可访问的IP地址,新用户 可配置为 “%” 表示所以ip都可以访问到

    查看mysql 开放端口

    show global variables like 'port';

  • 相关阅读:
    android监听屏幕打开关闭广播无响应的情况
    2020/4/9
    2020/4/8
    2020/4/7
    conda镜像
    2020/4/3
    2020/4/2
    2020/4/1
    EYELIKE源代码解读
    bzoj3162 独钓寒江雪
  • 原文地址:https://www.cnblogs.com/shiyalong/p/6397119.html
Copyright © 2011-2022 走看看