zoukankan      html  css  js  c++  java
  • MYSQL 简单操作

    1、grant语句

    格式:grant select on 数据库.* to 用户名@登录主机 identified by “密码”

    说明:

    (1)grant all 赋予所有的权限

    (2)demo.* 数据库 demo 中所有的表

    (3)newuser 用户名

    (4)@localhost 在本地电脑上的 mysql server 服务器

    (5)identfified by ‘password’ 设置密码

    设置root 用户 及密码root :GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;

    增加一个用户test1密码为abc,让他可以在任何主机上登录,并对所有数据库有查询、插入、修改、删除的权限。首先用以root用户连入MYSQL,然后键入以下命令:

    grant select,insert,update,delete on *.* to test1@“%” Identified by “abc”;


    mysql>GRANT ALL PRIVILEGES ON *.* TO monty@localhost IDENTIFIED BY ‘password’ WITH GRANT OPTION;
    mysql>GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON *.* TO custom@192.168.206.% IDENTIFIED BY ‘password’;

    ==============

    mysql>INSERT INTO user (host,user,password) VALUES(’192.168.206.%’,'high_vod’,PASSWORD(‘high_vod’));
    mysql>INSERT INTO db VALUES(’192.168.206.%’,'high_vod’,'high_vod’,'Y’,'Y’,'Y’,'Y’,'Y’,'Y’,'N’,'Y’,'Y’,'Y’,'Y’,'Y’,'Y’,'Y’,'Y’,'Y’,'Y’,'Y’,'Y’);
    mysql>FLUSH PRIVILEGES;

    ==============

    删除用户

    use mysql 
    mysql>Delete FROM user Where User="xxxxx" and Host="localhost"; 
    mysql>flush privileges;

  • 相关阅读:
    poj3083(Children of the Candy Corn)
    poj3278(Catch That Cow)
    poj2996(Help Me with the Game)
    poj2993(Emag eht htiw Em Pleh)
    js 对多sheet Excel赋值操作
    学习进度总结(三)
    学习进度总结(二)
    学习进度总结(一)
    《人月神话》阅读笔记(1)
    Android studio的安装与使用
  • 原文地址:https://www.cnblogs.com/zhzhao/p/4581219.html
Copyright © 2011-2022 走看看