MySQL Account Name

MySQL Account Name

MySQL Account Name

mysql5.6参考手册中如下解释:

MySQL account names consist of a user name and a host name. This enables creation of accounts for users with the same name who can connect from different hosts.

也就是说mysql的账号由一个用户名和主机名来组成,用来区分不同主机上的相同用户名。

 

write account names using the following rules:

 

  • Syntax for account names is 'user_name'@'host_name'.

  • An account name consisting only of a user name is equivalent to 'user_name'@'%'. For example, 'me' is equivalent to 'me'@'%'.

  • The user name and host name need not be quoted(引用) if they are legal(合法) as unquoted identifiers. Quotes are necessary to specify a user_name string containing special characters (such as “-”), or a host_name string containing special characters or wildcard(通配符) characters (such as “%”); for example, 'test-user'@'%.com'.

  • Quote user names and host names as identifiers or as strings, using either backticks (“`”), single quotation marks (“'”), or double quotation marks (“"”).(使用单引号或双引号)

  • The user name and host name parts, if quoted, must be quoted separately. That is, write 'me'@'localhost', not'me@localhost '; the latter is interpreted as 'me@localhost '@'%'.

  • A reference to the CURRENT_USER or CURRENT_USER() function is equivalent to specifying the current client's user name and host name literally.

详见:http://dev.mysql.com/doc/refman/5.6/en/account-names.html

============END============

转载于:https://my.oschina.net/xinxingegeya/blog/271277

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值