文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>MySQL帐户管理

MySQL帐户管理

时间:2010-05-07  来源:linuxangie

一.添加用户

1.Insert into user ( user,host,password ) values ('linux','%',password('linuxangie  '));
  此语句MySQL 5.0以上版本不支持。

2.Grant all on *.* to 'linux'@'%'identified by 'linuxangie';
  添加用户linux,密码为linuxangie,拥有所有权限。

3.Grant usage on *.* to 'angie'@'%' identified by 'linuxangie';
  Grant select, insert, update, delete, create, drop, reload, shutdown, process, file, grant, references, index, alter, show databases, super, create temporary tables, lock tables, execute, replication slave, replication client on *.* to 'angie'@'%';
  Grant usage on *.* to 'angie'@'%' with grant option;
  注:第2语句相当于第3语句。

 

二.删除root@localhost帐户和空用户名的帐户
1.   Delete from user where user='';
2.   Delete from user where user='root'and host='locahost';

3.   删除''和'linux','angie'的三个帐户

     Delete  from user where user=' 'or user='linuxwei' or user='angie';


三.修改linux用户名和密码

    Update user set user='linuxangie' where user='linux';

    Update user set password=password('linuxangie  ') where user='linuxangie';

    Select * from user;

四.权限刷新

    Flush privileges;

排行榜 更多 +
XLM币最具爆发力的安全交易所币安binance下载

XLM币最具爆发力的安全交易所币安binance下载

金融理财 下载
XEM币最安全隐私链的全球交易所币安binance下载

XEM币最安全隐私链的全球交易所币安binance下载

金融理财 下载
WAVES币最新上线的优质交易所币安binance下载

WAVES币最新上线的优质交易所币安binance下载

金融理财 下载