linux 下 mysql 添加用户及管理用户

论坛 期权论坛 脚本     
匿名技术用户   2021-1-4 07:13   11   0

mysql添加用户方法

建立数据库gamesp

create database gamesp;

添加用户

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


grant all on gamesp.* to newuser@localhost identified by 'password';

说明:

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

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

(3)newuser 用户名

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

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



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



修改密码
mysqladmin -uroot -plk317921web password "111111"
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP