J4 Issue ?
avatar pe7er
pe7er
21 Apr 2019

It seems not possible anymore to use a hyphen in a MySQL database name (like "joomla-cms").

Steps to reproduce the issue

Install Joomla and use a database name with a hyphen in the name, for example joomla-cms

Expected result

In Joomla 3.x you could use a hyphen in the database name.
I would expect to do the same in Joomla 4.

Actual result

Trying to use a MySQL database called "joomla-cms" resulted in the following warning:
The database name is invalid. It must start with a letter, followed by alphanumeric characters.

A workaround is to use an underscore instead, like joomla-cms

System information (as much as possible)

Joomla 4.0-dev
PHP 7.2.17-1
MySQL 5.5.5-10.1.37-MariaDB-0+deb9u1

avatar pe7er pe7er - open - 21 Apr 2019
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Apr 2019
Title
[installation] Hyphen not allowed anymore in MySQL database name?
Hyphen not allowed anymore in MySQL database name?
avatar franz-wohlkoenig franz-wohlkoenig - edited - 21 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Apr 2019
Labels Added: J4 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 21 Apr 2019
avatar brianteeman
brianteeman - comment - 21 Apr 2019

This is the relevant line in the code

if (in_array($options->db_type, ['mysql', 'mysqli']) && preg_match('#[\\\\\/\.]#', $options->db_name))

avatar pe7er
pe7er - comment - 21 Apr 2019

PR: #24658

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 21 Apr 2019

Closed as having Pull Request.

avatar franz-wohlkoenig franz-wohlkoenig - close - 21 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Apr 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-04-21 11:37:41
Closed_By franz-wohlkoenig

Add a Comment

Login with GitHub to post a comment