|When restoring your MySQL databases, if you run into this error:|
Unable to add user username_dbuser. String 'username_dbuser' is too long for user name (should be no longer than 16)
Although there are settings in the mysql.user and mysql.db tables which control then max length of the username, MySQL clearly states that they cannot be changed:
"The limit on MySQL user name length is hard-coded in the MySQL servers and clients, and trying to circumvent it by modifying the definitions of the tables in the mysql database does not work."
The solution (with regards to DA) is to shorten the DA username, so that the total length of the db user is shorter.
There are 2 ways of doing this:
1) Change the existing username and restore again from that User's backups folder:
/home/username/backupswhere this path is needed, as it's a username independent restore area.
2) Or delete the existing User, rename the backup to a shorter name, and restore again, eg:
3) This last option is more difficult, but will shorten the database name and db usernames, rather than changing the DA username.
- Using this guide, you can extract the current tar.gz backup file.
- In the "backup" directory, each MySQL database will have 3 files, eg:
- Also edit the username_dbname.confand change any username_dbuser= entries which are more than 16 characters.
- Repack the tar.gz.
If you're seeing the word "collation" in the error, ensure you're restoring onto DA version 1.43.0 or newer, with regards to this change:
© 2018 JBMC Software, Suite 173 3-11 Bellerose Drive, St Albert, AB T8N 1P7 Canada. Mon-Fri 9AM-5PM MST