Mysql:set password
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Mysql:set password,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4332字,纯文字阅读大概需要7分钟。
内容图文
![Mysql:set password](/upload/InfoBanner/zyjiaocheng/520/cd077b624ea84a6b9c9d301e9da782d8.jpg)
account to connect to the server using either the primary or
secondary password. (Exception: If the new password specified by the
SET PASSWORD statement is empty, the secondary password becomes empty
as well, even if RETAIN CURRENT PASSWORD is given.)
For more information about use of dual passwords, see:
https://dev.mysql.com/doc/refman/8.0/en/password-management.html.
#-----------------------------------------------------
SET PASSWORD permits these auth_option syntaxes:
o = ‘auth_string‘
Assigns the account the given literal password.
o TO RANDOM
Random password generation is available as of MySQL 8.0.18.
Assigns the account a password randomly generated by MySQL. The
statement also returns the cleartext password in a result set to make
it available to the user or application executing the statement.
For details about the result set and characteristics of randomly
generated passwords, see:
https://dev.mysql.com/doc/refman/8.0/en/password-management.html#random-password-generation.
#-----------------------------------------------------
*Important*:
Under some circumstances, SET PASSWORD may be recorded in server logs or on the client side in a history file such as ~/.mysql_history, which means that cleartext passwords may be read by anyone having read access to that information.
For information about the conditions under which this occurs for the server logs and how to control it, see:
https://dev.mysql.com/doc/refman/8.0/en/password-logging.html.
For information about client-side logging, see:
https://dev.mysql.com/doc/refman/8.0/en/mysql-logging.html.
#-----------------------------------------------------
SET PASSWORD can be used with or without a FOR clause that explicitly names a user account:
o With no FOR user clause, the statement sets the password for the current user:
SET PASSWORD = ‘auth_string‘;
Any client who connects to the server using a nonanonymous account can change the password for that account. (In particular, you can change your own password.)
To see which account the server authenticated you as, invoke the CURRENT_USER() function:
SELECT CURRENT_USER();
o With a FOR user clause, the statement sets the password for the named account, which must exist:
SET PASSWORD FOR ‘jeffrey‘@‘localhost‘ = ‘auth_string‘;
If a FOR user clause is given, the account name uses the format described in:
https://dev.mysql.com/doc/refman/8.0/en/account-names.html.
For example:
SET PASSWORD FOR ‘bob‘@‘%.example.org‘ = ‘auth_string‘;
The host name part of the account name, if omitted, defaults to ‘%‘.
#-----------------------------------------------------
SET PASSWORD interprets the string as a cleartext string, passes it to
the authentication plugin associated with the account, and stores the
result returned by the plugin in the account row in the mysql.user system table.
(The plugin is given the opportunity to hash the value into the encryption format it expects.
The plugin may use the value as specified, in which case no hashing occurs.)
#-----------------------------------------------------
Setting the password for a named account (with a FOR clause) requires
the UPDATE privilege for the mysql system schema. Setting the password
for yourself (for a nonanonymous account with no FOR clause) requires
no special privileges.
Statements that modify secondary passwords require these privileges:
o The APPLICATION_PASSWORD_ADMIN privilege is required to use the
RETAIN CURRENT PASSWORD clause for SET PASSWORD statements that apply
to your own account. The privilege is required to manipulate your own
secondary password because most users require only one password.
o If an account is to be permitted to manipulate secondary passwords
for all accounts, it should be granted the CREATE USER privilege
rather than APPLICATION_PASSWORD_ADMIN.
When the read_only system variable is enabled, SET PASSWORD requires
the CONNECTION_ADMIN or SUPER privilege in addition to any other required privileges.
URL: https://dev.mysql.com/doc/refman/8.0/en/set-password.html
Mysql:set password
标签:account import example creat oppo stat lang ash inf
本文系统来源:https://www.cnblogs.com/jinzhenshui/p/12485515.html
内容总结
以上是互联网集市为您收集整理的Mysql:set password全部内容,希望文章能够帮你解决Mysql:set password所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。
来源:【匿名】