首页 > 数据库技术 > 详细

MySql 账户管理

时间:2016-01-28 12:16:01      阅读:190      评论:0      收藏:0      [点我收藏+]

MySql 账户管理

  You must connect to the MySQL server as the MySQL root user, which has the CREATE USER privilege. 

  CREATE USER creates a new row in the mysql.user table. 

  Example 1: Create an account that uses the default authentication plugin and the given password. Mark the password expired so that the user must choose a new one at the first connection to the server:

  技术分享

  Example 2: Create an account that uses the sha256_password authentication plugin and the given password. Require that a new password be chosen every 180 days:

  技术分享

  Example: This statement creates two accounts, each with the default authentication plugin and named password. For both accounts, connections must be made using a valid X509 certificate and up to 60 queries per hour are permitted. Both accounts are locked initially, so effectively they are placeholders and cannot be used until an administrator unlocks them:

  技术分享

  grant 语句示例:

  技术分享

  删除用户:

  技术分享

  设置密码:

  技术分享

参考:http://dev.mysql.com/doc/refman/5.7/en/account-management-sql.html  

MySql 账户管理

原文:http://www.cnblogs.com/tekkaman/p/5165707.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!