mysql添加(删除)用户方法

来源:互联网 发布:怎么改淘宝手机号 编辑:程序博客网 时间:2024/04/30 10:29

1.建立数据库oracleDB

create database oracleDB;

2.添加用户

grant all on 数据库名.* to 用户名@localhost identifiedby '密码';

grant all on oracleDB.* to userName@localhost identified by 'password';

说明:

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

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

(3)newuser 用户名

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

(5)identfified by 'password' 设置密码

后记:

1.删除用户
mysql>Delete FROM user Where User="xxxxx" and Host="localhost";
mysql>flush privileges;

2.添加一个远程用户,名为username密码为password
GRANT ALL PRIVILEGES ON *.* TO username@"%" IDENTIFIED BY 'password'