Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Database Server
  • Search

Adding database → Error: db_user .. is not valid

Questions regarding the Database Server
MySQL, PostgreSQL, MariaDB, Percona Server, phpMyAdmin, phpPgAdmin
Locked
  • Print view
Advanced search
14 posts
  • 1
  • 2
  • Next
danielnr87
Posts: 2
Joined: Mon Apr 14, 2014 12:57 pm

Adding database → Error: db_user .. is not valid

Post by danielnr87 » Tue Apr 15, 2014 4:03 pm

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
Top

rhedges
Posts: 1
Joined: Fri Apr 18, 2014 10:18 am

Re: Adding database → Error: db_user .. is not valid

Post by rhedges » Fri Apr 18, 2014 10:20 am

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.
Top

kreativbureau
Posts: 14
Joined: Sun Apr 06, 2014 2:13 pm

Re: Adding database → Error: db_user .. is not valid

Post by kreativbureau » Tue Jun 17, 2014 3:26 pm

Hi

Im also experience the same issue, have you manage to resolve this?

Thanks for your help

Br
Mike
Top

imperio
VestaCP Team
Posts: 7000
Joined: Sat Dec 01, 2012 12:37 pm
Contact:
Contact imperio
Website

Re: Adding database → Error: db_user .. is not valid

Post by imperio » Sat Jun 28, 2014 6:27 pm

Hi,
write more about your problem
the database user should be not longer than 16 characters (together with the prefix of user)
Top

xgalen
Posts: 1
Joined: Wed Jul 16, 2014 8:50 pm

Re: Adding database → Error: db_user .. is not valid

Post by xgalen » Wed Jul 16, 2014 8:55 pm

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.
Top

lookup
Posts: 2
Joined: Thu Jun 12, 2014 5:16 pm

Re: Adding database → Error: db_user .. is not valid

Post by lookup » Wed Jul 16, 2014 9:57 pm

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 :)
Top

izum
Posts: 1
Joined: Tue Aug 19, 2014 10:41 am

Re: Adding database → Error: db_user .. is not valid

Post by izum » Tue Aug 19, 2014 10:46 am

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.
Top

imperio
VestaCP Team
Posts: 7000
Joined: Sat Dec 01, 2012 12:37 pm
Contact:
Contact imperio
Website

Re: Adding database → Error: db_user .. is not valid

Post by imperio » Tue Aug 19, 2014 11:44 am

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
Top

Mihanja80
Posts: 37
Joined: Fri Feb 13, 2015 6:55 pm
Contact:
Contact Mihanja80
Website

Re: Adding database → Error: db_user .. is not valid

Post by Mihanja80 » Fri Feb 13, 2015 8:09 pm

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? :)
Top

kallovsky
Posts: 19
Joined: Thu Mar 05, 2015 12:00 pm

Re: Adding database → Error: db_user .. is not valid

Post by kallovsky » Tue Mar 10, 2015 12:21 pm

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.
Top


Locked
  • Print view

14 posts
  • 1
  • 2
  • Next

Return to “Database Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password