Page 1 of 2
Adding database → Error: db_user .. is not valid
Posted: Tue Apr 15, 2014 4:03 pm
by danielnr87
Hi,
Is anyone experiencing an error when adding a database? I have created one on another user fine, but for some reason every time I enter a db user when creating one it gives me an error saying that db_user is not valid.
Any ideas?
Thanks
Dan Williams
Re: Adding database → Error: db_user .. is not valid
Posted: Fri Apr 18, 2014 10:20 am
by rhedges
I too am having this issue.
I've read it has something to do with the length of the values entered (including the name of the account) being too long for MySQL. Bit of a pain if it is that because I was planning on setting the name of the account to the domain name for that account, and some of them can be quite long.
Re: Adding database → Error: db_user .. is not valid
Posted: Tue Jun 17, 2014 3:26 pm
by kreativbureau
Hi
Im also experience the same issue, have you manage to resolve this?
Thanks for your help
Br
Mike
Re: Adding database → Error: db_user .. is not valid
Posted: Sat Jun 28, 2014 6:27 pm
by imperio
Hi,
write more about your problem
the database user should be not longer than 16 characters (together with the prefix of user)
Re: Adding database → Error: db_user .. is not valid
Posted: Wed Jul 16, 2014 8:55 pm
by xgalen
Hi imperio,
my prefix has 15 characters, plus "_".. total 16 characters. So I can't add nothing but I can't leave blank the field...
¿Any solution, please?
Thank you in advance.
Re: Adding database → Error: db_user .. is not valid
Posted: Wed Jul 16, 2014 9:57 pm
by lookup
Hiya
What I did was edit main.sh ( /usr/local/vesta/func ) line 811 to This:
dbuser) validate_format_dbuser "${arg:0:16}" 'db_user';;
AND
in v-add-database (/usr/local/vesta/bin/) line 77 to This:
str="DB='$database' DBUSER='${dbuser:0:16}' MD5='$md5' clear=$dbpass HOST='$host' TYPE='$type'"
That takes care of the validation and shortens the username to the MAX for mysql of 16 chars whilst keeping inline with naming convention as I understand it (username_DBuser) to keep tabs on users DBs...
Probably the best solution would be to edit the front end and make the validation there.. but this works just fine it will shorten the name by latter part if to long to 16 chars.
Cheers :)
Re: Adding database → Error: db_user .. is not valid
Posted: Tue Aug 19, 2014 10:46 am
by izum
What if i have prefix of db name and user length of 16 symbols? How to change principal of creating prefixes?
And without any symbol of current db it wont create.
I am still can not create database. Thank you.
Re: Adding database → Error: db_user .. is not valid
Posted: Tue Aug 19, 2014 11:44 am
by imperio
izum wrote:What if i have prefix of db name and user length of 16 symbols? How to change principal of creating prefixes?
And without any symbol of current db it wont create.
I am still can not create database. Thank you.
I don't see the problem in your case
you can create any short user name
Re: Adding database → Error: db_user .. is not valid
Posted: Fri Feb 13, 2015 8:09 pm
by Mihanja80
Error: db_user Mihanja80_Mihanja80 is not valid.
Put the panel for the test, the same problem!
I do not understand why you made a limit of 16 characters and does not show this warning in the panel? Simply print the warning on the entry form.
And if the user login will be 16 characters long, what to do then? :)
Re: Adding database → Error: db_user .. is not valid
Posted: Tue Mar 10, 2015 12:21 pm
by kallovsky
lookup wrote:Hiya
What I did was edit main.sh ( /usr/local/vesta/func ) line 811 to This:
dbuser) validate_format_dbuser "${arg:0:16}" 'db_user';;
AND
in v-add-database (/usr/local/vesta/bin/) line 77 to This:
str="DB='$database' DBUSER='${dbuser:0:16}' MD5='$md5' clear=$dbpass HOST='$host' TYPE='$type'"
That takes care of the validation and shortens the username to the MAX for mysql of 16 chars whilst keeping inline with naming convention as I understand it (username_DBuser) to keep tabs on users DBs...
Probably the best solution would be to edit the front end and make the validation there.. but this works just fine it will shorten the name by latter part if to long to 16 chars.
Cheers :)
That works like a charm! Thanks for that! One thing: In my version of vestacp it was line 883 of main.sh.