Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Error! Invalid database name. #527

Closed
shefik opened this Issue · 13 comments

4 participants

@shefik

I get this message when trying to do a clean install:

"Error! Invalid database name. Please use only letters, numbers, '-' or '_' with a maximum of 64 characters."

However, when I use MAMP to create a MySQL database, I am able to successfully create new database, with a name such as:

"example.database.dyndns-web.com"

So, is there any particular reason why Zikula has that database naming restriction? MySQL doesn't appear to have such a restriction. Can we remove that restriction in Zikula?

@phaidon
Owner

I can not confirm the problem with my mamp. Which versions of php and mysql are you using?

@Portugao

Sorry. I don't understand really.

When do you get this error under which system?

@phaidon
Owner

@shefik can you give us some more details. Thanks

@cmfcmf
Owner

Actually, you can reproduce this so: Create a database called test.test via phpmyadmin. Now try to install Zikula using this database. The installer will tell you that he does not want to install Zikula using this database because it contains a ..
@shefik Now asks why Zikula checks the database name.

I think this is from times where Zikula was able to create a database on it's own.
IMHO we should remove this check. If the user somehow managed to create a database called "345..%&$:f-t5" Zikula should accept that and use it.

Comments?

@shefik

That is an accurate description of the issue.

@phaidon
Owner

I could not find something about a character limitation of database names in doctrine. But on the side your are on the secure side with "normal" characters.

@phaidon
Owner

@drak What is your opinion about it.

@ghost

Having run a hosting company for more than a decade I can honestly say, I have never come across a mysql database with a . in it. not once. The convention is to use underscores and dashes e.g. yourdomain_com_-_zikula so such things so on that basis alone, I would not welcome removing the restriction. But, looking at the MySQL databse name restrictions they are not allowed... and remember, this has to be cross DB compliant so even if one DB allowed it, another might not: see http://dev.mysql.com/doc/refman/5.0/en/identifiers.html

specifically

Permitted characters in unquoted identifiers: ASCII: [0-9,a-z,A-Z$_] (basic Latin letters, digits 0-9, dollar, underscore)

Database and table names cannot contain “/”, “\”, “.”, or characters that are not permitted in file names.

@ghost ghost closed this
@shefik

@drak I think this issue needs to be reopened. While it's true it was not allowed in MySQL 5.0 (as referenced by the docs you quoted), that restriction no longer applies with newer versions of MySQL. It is now permissible.

"Before MySQL 5.1.6, database and table names cannot contain “/”, “\”, “.”, or characters that are not permitted in file names."

http://dev.mysql.com/doc/refman/5.1/en/identifiers.html

@ghost

@shefik as I said, this is not just about MySQL, but all databases. There is no reason you need to have weirdly named databases.

@shefik

I understand you are saying it's not just about MySQL. However, as of now, it shouldn't be considered "weirdly named". For example, I created a database that matches a host name (with "."). It is valid. If I choose to install Zikula on a MySQL database, I should be allowed to make use of what is permissible with MySQL.

@ghost
@shefik

@drak Ok, understandable.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.