raksmart活动促销

分享

写回答

发帖

现在的LP主机里 MYsql数据库用户名问题

国外虚拟主机 国外虚拟主机 3035 人阅读 | 2 人回复

发表于 2011-4-26 20:32:41 | 显示全部楼层 |阅读模式

现在的LP主机里 MYsql数据库用户名问题

现在的用户名怎么加上@  还要加什么什么的。。搞不懂了。

难道一定要[email=]'user_name'@'host_name'[/email] 这样的吗?

我怎么安装不了shopex了呢??


请高手指点



http://dev.mysql.com/doc/refman/5.0/en/account-names.html

解释这样的。。

In SQL statements such as
CREATE USER,
GRANT, and
SET PASSWORD, 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'@'%'.


MySQL stores account names in grant tables in the
mysql
database using separate columns for the user name and host name parts:

  • The
    user
    table contains one row for each account. The
    User
    and
    Host
    columns store the user name and host name. This table also indicates which global privileges the account has.
  • Other grant tables indicate privileges an account has for databases and objects within databases. These tables have
    User
    and
    Host
    columns to store the account name. Each row in these tables associates with the account in the
    user
    table that has the same
    User
    and
    Host
    values.
  • A reference to the
    CURRENT_USER()
    (or
    CURRENT_USER) function is equivalent to specifying the current user's name and host name literally.


For additional detail about grant table structure, see
Section 5.4.2, “Privilege System Grant Tables”.

User names and host names have certain special values or wildcard conventions, as described following.
A user name is either a nonblank value that literally matches the user name for incoming connection attempts, or a blank value (empty string) that matches any user name. An account with a blank user name is an anonymous user. To specify an anonymous user in SQL statements, use a quoted empty user name part, such as''@'localhost'.
The host name part of an account name can take many forms, and wildcards are permitted:
  • A host value can be a host name or an IP address. The name
    'localhost'
    indicates the local host. The IP address
    '127.0.0.1'
    indicates the loopback inte**ce.

  • You can use the wildcard characters “%” and “_” in host values. These have the same meaning as for pattern-matching operations performed with the
    LIKE
    operator. For example, a host value of
    '%'
    matches any host name, whereas a value of
    '%.mysql.com'
    matches any host in the
    mysql.com
    domain.
    '192.168.1.%'
    matches any host in the 192.168.1 class C network.

    Because you can use IP wildcard values in host values (for example,
    '192.168.1.%'
    to match every host on a subnet), someone could try to exploit this capability by naming a host
    192.168.1.somewhere.com. To foil such attempts, MySQL disallows matching on host names that start with digits and a dot. Thus, if you have a host named something like
    1.2.example.com, its name never matches the host part of account names. An IP wildcard value can match only IP addresses, not host names.

  • For a host value specified as an IP address, you can specify a netmask indicating how many address bits to use for the network number. The syntax is
    host_ip/netmask. For example:

    CREATE USER 'david'@'192.58.197.0/255.255.255.0';This enables
    david
    to connect from any client host having an IP address
    client_ip
    for which the following condition is true:

    client_ip & netmask = host_ipThat is, for the
    CREATE USER
    statement just shown:

    client_ip & 255.255.255.0 = 192.58.197.0IP addresses that satisfy this condition and can connect to the MySQL server are those in the range from192.58.197.0
    to
    192.58.197.255.

    The netmask can only be used to tell the server to use 8, 16, 24, or 32 bits of the address. Examples:
    • 192.0.0.0/255.0.0.0: Any host on the 192 class A network
    • 192.168.0.0/255.255.0.0: Any host on the 192.168 class B network
    • 192.168.1.0/255.255.255.0: Any host on the 192.168.1 class C network
    • 192.168.1.1: Only the host with this specific IP address

    The following netmask will not work because it masks 28 bits, and 28 is not a multiple of 8:

回答|共 2 个

哥是浮云

发表于 2011-4-27 07:43:32 | 显示全部楼层

你用的是lpcp面板吧,这个面板需要添加@后面的东西的,具体你贴图上来我给你解答,不过要等因为我也不是经常有时间上论坛。
RAKSmart

xiaoliu123

发表于 2011-5-24 21:42:23 | 显示全部楼层

看完楼主的这个帖子之后,我竟产生出一种无以名之的悲痛感——啊,这么好的帖子,如果将来我再也看不到了,那我该怎么办?那我该怎么办?直到我毫不犹豫地把楼主的这个帖子收藏了,我内心的那种激动才逐渐平静下来。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则