3

When I try to create a MySQL username for a user at a particular host, I get the message:

MariaDB [(none)]> create user 'dbwriter'@'test.hat.company.com' identified by 'dbpassword++';
ERROR 1396 (HY000): Operation CREATE USER failed for 'dbwriter'@'test.hat.company.com' is too long for user name (should be no longer than 16)

The problem is that I can't make the string shorter. Some pages advise hard-coding an IP address. That's poor practice and, worse, it won't work with IPv6.

What is the option?

vy32
  • 28,461
  • 37
  • 122
  • 246
  • 1
    do `show create table mysql.user`. on my 5.7.13 install, it's `Host char(60), User char(32)`. what you have shouldn't have any trouble fitting... – Marc B Sep 02 '16 at 15:29
  • 1
    `select @@version;` – Drew Sep 02 '16 at 15:31
  • maybe it is this bug http://stackoverflow.com/q/5555328 – Drew Sep 02 '16 at 15:52
  • 1
    The thing is... "dbwriter" is not too long for `User`. The length is less than the 16 character limit, And the value of `Host` is less than the 60 character limit. So there's something wonky going on. Error 1396 can probably occur for a variety of reasons. The portion of the error that reads "is too long for user name (should be no longer than 16)" seems a bit odd. When I get that message, it's associated with Error 1470, not 1396. Before we jump to "it's a bug", we'd really need some more information about the version and build. Is this a MySQL distribution, or MariaDB? What version? – spencer7593 Sep 02 '16 at 15:54
  • `5.5.50-MariaDB`. Took a bit of time to find a decent work-around. – vy32 Sep 02 '16 at 16:43

0 Answers0