Ticket #2342 (closed defect: fixed)

Opened 10 months ago

Last modified 3 days ago

Database name with dash/hyphen can't be used

Reported by: bmatzner Owned by: aoneil
Priority: medium Milestone: 2.3.0 stable*
Component: CMS - Installer Version: 2.2.2-rc1
Severity: medium effort / impact Keywords: database, installer
Cc: Hours:

Description

The install dialog automatically removes dashes from the database name. There should not be unnecessary restrictions to database names, as some ISP have their naming standards that can't be controlled. In my case, I had to change the db name to something the installer accepts, then change it afterwards and manually alter the config file. Now it works, but this could be a blocker if you can't rename databases. Also valid in 2.2.1

Change History

Changed 10 months ago by ischommer

  • milestone changed from 2.2.2-rc3 to 2.2.3 feature-lock

Good idea; we'll have a look at this in the next version. Right now we're focusing on nailing bugs that were working in previous releases -- this doesn't fall into that category.

Changed 5 months ago by Blynx

There are 2 simple fixes:
1) Turn off Javascript, or
2) Edit the "config-form.html" in the root directory, and replace line 110

<span class="middleColumn"><input id="mysql_database" class="text" type="text" name="mysql[database]" value="<?php echo $databaseConfig['database']; ?>" onchange="this.value = this.value.replace(/[^A-Za-z0-9_]+/g,'');" /></span>

with

<span class="middleColumn"><input id="mysql_database" class="text" type="text" name="mysql[database]" value="<?php echo $databaseConfig['database']; ?>" onchange="this.value = this.value.replace(/[^A-Za-z0-9_-]+/g,'');" /></span>

The same way you can add any character into the regular expression and use whatever database name you like.

Cheers, Blynx

btw: Is there any way to submit such comments as a patch, instead if just a simple comment?

Changed 3 months ago by ischommer

  • priority changed from critical to medium
  • component changed from (Unknown) to CMS - Installer
  • milestone changed from 2.2.3* to 2.3.0

Changed 3 months ago by sminnee

  • milestone changed from 2.3.0 to 2.3.1*

Changed 2 weeks ago by lenix

it should be easier to fix than to change to milestone..

http://dev.mysql.com/doc/refman/5.0/en/identifiers.html explains valid database-names.

Changed 3 days ago by smagnusson

  • summary changed from Database name with dash can't be used to Database name with dash/hyphen can't be used

Changed 3 days ago by smagnusson

I have confirmed that the bug is limited to not escaping the "CREATE DATABASE command"

With 2.3.0rc2 if you manually create "SS-mysite" and then use that in the installer, where it will say 'database exists', and then click 'install', all works perfectly. The installer has no errors, and the website/CMS loads correctly.

So, the current workaround is to edit sapphire/dev/install/config-form.html as above, to allow hyphens in the name, and to create the database manually before clicking 'install'.

Changed 3 days ago by sminnee

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from 2.3.1 to 2.3.0 stable*

Fixed in r69715.

Note: See TracTickets for help on using tickets.