473,320 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

More on a bug in MySQL 3.23.58

This may be old news, but it's kinda frustrating and I wonder if
Something Can Be Done:
mysql> grant all on *.* to 'jeff_dev@localhost' identified by
'my^son^daniel';
ERROR 1145: The host or user argument to GRANT is too long
mysql> grant all on *.* to 'q_dev@localhost' identified by
'my^son^daniel';
Query OK, 0 rows affected (0.00 sec)

If memory serves me, a host name in the DNS system can be 255
characters altogether. If you assume that a UNIX username is 8
characters (I know, I know, UNIX usernames have nothing to do with
MySQL usernames), that means that a MySQL username must be at least
264 chars long, and if you assume that the user name will have a
string such as _dev _test _prod, etc., appended then 270 chars is more
reasonable from a user point of view.

Or is there another solution that eludes me?

Many thanks,
Jeff
Jul 20 '05 #1
4 1805
Jeff Silverman wrote:
This may be old news, but it's kinda frustrating and I wonder if
Something Can Be Done:
mysql> grant all on *.* to 'jeff_dev@localhost' identified by
'my^son^daniel';
ERROR 1145: The host or user argument to GRANT is too long
mysql> grant all on *.* to 'q_dev@localhost' identified by
'my^son^daniel';
Query OK, 0 rows affected (0.00 sec)

If memory serves me, a host name in the DNS system can be 255
characters altogether. If you assume that a UNIX username is 8
characters (I know, I know, UNIX usernames have nothing to do with
MySQL usernames), that means that a MySQL username must be at least
264 chars long, and if you assume that the user name will have a
string such as _dev _test _prod, etc., appended then 270 chars is more
reasonable from a user point of view.

Or is there another solution that eludes me?

Many thanks,
Jeff

Am I missing something here?

Although a host name CAN be 255 characters long, who in their right mind
will use one of that length?
Jul 20 '05 #2
Jeff Silverman wrote:
mysql> grant all on *.* to 'jeff_dev@localhost' ...
ERROR 1145: The host or user argument to GRANT is too long


Look at the table 'user' in the 'mysql' database. The user field is 16
characters, and the host field is 60 characters. So there should be
enough storage available for 'jeff_dev' as the user, and 'localhost' as
the host.

However, by putting the entire 'user@host' string in quotes, you're
telling MySQL that it's all the username, and that you aren't using the
(optional) host specification. You're trying to fit the 18-character
string 'jeff_dev@localhost' into a 16-character field.

The syntax examples I see in the MySQL manual show quoting the user and
host portions individually. So try this:

grant all on *.* to 'jeff_dev'@'localhost' ...

Also read the following excerpt from
http://mysql.he.net/doc/mysql/en/GRANT.html:

In order to accommodate granting rights to users from arbitrary hosts,
MySQL supports specifying the user value in the form
user_name@host_name. If you want to specify a user_name string
containing special characters (such as `-'), or a host_name string
containing special characters or wildcard characters (such as `%'), you
can quote the username or hostname (for example,
'test-user'@'test-hostname'). Quote the username and hostname separately.

You can specify wildcards in the hostname. For example,
user_name@'%.loc.gov' applies to user_name for any host in the loc.gov
domain, and user_name@'144.155.166.%' applies to user_name for any host
in the 144.155.166 class C subnet.

The simple form user_name is a synonym for user_name@'%'.

Regards,
Bill K.
Jul 20 '05 #3
2metre <2m****@xxxhersham.net> wrote in message news:<ck**********@sparta.btinternet.com>...
Jeff Silverman wrote:

....

If memory serves me, a host name in the DNS system can be 255
characters altogether. ....
Many thanks,
Jeff

Am I missing something here?

Although a host name CAN be 255 characters long, who in their right mind
will use one of that length?


I should have written "a fully qualified domain name (FQDN)" instead
of host name. Refer to http://en.wikipedia.org/wiki/FQDN and also
RFCs 1035 and 1123. The reason it becomes an issue is if you have lots
of subdomains, e.g.

mylittlehost.mylittlegroup.mygroup.myorg.mysubdivi sion.mydivision.mycompany.myholdingcompany.com

I agree with the thrust of your comment, however. Just because you
*can* do something, doesn't necessarily mean you *should* do that
thing. On the other hand, if *can* do something, then whatever
solution for any other problem that relates to the thing ought to
support that thing. So while 255 character FQDNs are a dumb thing to
do, that's what the RFC says is allowed, so anything that uses
hostnames should support 255 character FQDNs.
Jeff
Jul 20 '05 #4
Thank you.
Jeff
Bill Karwin <bi**@karwin.com> wrote in message news:<ck********@enews1.newsguy.com>...
Jeff Silverman wrote:
mysql> grant all on *.* to 'jeff_dev@localhost' ...
ERROR 1145: The host or user argument to GRANT is too long


Look at the table 'user' in the 'mysql' database. The user field is 16
characters, and the host field is 60 characters. So there should be
enough storage available for 'jeff_dev' as the user, and 'localhost' as
the host.

However, by putting the entire 'user@host' string in quotes, you're
telling MySQL that it's all the username, and that you aren't using the
(optional) host specification. You're trying to fit the 18-character
string 'jeff_dev@localhost' into a 16-character field.

The syntax examples I see in the MySQL manual show quoting the user and
host portions individually. So try this:

grant all on *.* to 'jeff_dev'@'localhost' ...

Also read the following excerpt from
http://mysql.he.net/doc/mysql/en/GRANT.html:

In order to accommodate granting rights to users from arbitrary hosts,
MySQL supports specifying the user value in the form
user_name@host_name. If you want to specify a user_name string
containing special characters (such as `-'), or a host_name string
containing special characters or wildcard characters (such as `%'), you
can quote the username or hostname (for example,
'test-user'@'test-hostname'). Quote the username and hostname separately.

You can specify wildcards in the hostname. For example,
user_name@'%.loc.gov' applies to user_name for any host in the loc.gov
domain, and user_name@'144.155.166.%' applies to user_name for any host
in the 144.155.166 class C subnet.

The simple form user_name is a synonym for user_name@'%'.

Regards,
Bill K.

Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: NotGiven | last post by:
I am researching the best place to put pictures. I have heard form both sides and I'd like to know why one is better than the other. Many thanks!
0
by: Krasimir_Slaveykov | last post by:
Hello mysql, If I have one main table - Tab1 and 2 or more tables wich are related with Tab1, but Tab2 possibly will have records for each in Tab1 ot possibly not. Tab3-too. So I need to join...
0
by: Degan, George E, JR, MGSVC | last post by:
I am attempting to create a temporary table to do a complex query and I = get an error: error 1044: Access denied for user: '@localhost' to database = 'shopsample' what can I do to keep this from...
0
by: Karam Chand | last post by:
Greetings I have a table with the following table structure - mysql> desc email_table; +---------+---------------+-------------------+------+-----+---------+-------+ | Field | Type ...
4
by: mikey | last post by:
Hi all, I'm having great problems trying to install the latest MySQl RPM package onto my Red Hat Linux OS. There is already MySQL v 3.0 pre-installed with the RH Linux distribution disk but I...
0
by: Google Mike | last post by:
This has been discussed before back in 2002, and then in Feb of 2003 when I did a search on Google Groups for MySQL Table Sizes. Back then, people said go here: ...
2
by: Gnurp Gnarp | last post by:
How do I prevent the MySQL client to scroll pages when the results of a query exceeds the number of lines in the terminal window? Like a MySQL equivalent to *nix 'more'. mysql> select foo from...
1
by: meulie | last post by:
Hi all! Is it possible to bind MySQL 4.1 to more than 1 interface? Will multiple 'bind-address=x.x.x.x' statements do the job? Regards, Evert
2
by: Ted | last post by:
1) In several tables, in my MySQL version, I created columns using something like the following: `ab_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, This...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.