当我尝试为特定主机上的用户创建MySQL用户名时,我收到消息:
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)
问题在于我无法缩短字符串。有些页面建议对IP地址进行硬编码。这种做法很糟糕,更糟糕的是,它不能与IPv6合作。
有什么选择?