Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Bug: SQL database names containing hyphens not possible #1280

Open
ghost opened this issue Jun 8, 2018 · 3 comments
Open

Bug: SQL database names containing hyphens not possible #1280

ghost opened this issue Jun 8, 2018 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Jun 8, 2018

Summary

When installing Anchor from scratch, it is not able to get access to the server's database because of a SQL syntax error when the database's name has a particular format (containing hyphens)

Expected Behaviour

Settle up Anchor's database structure during installation.

Actual Behaviour

  1. Start installation of Anchor CMS
  2. When it comes to database setup, fill in the database's name. For me in particular it was starting with "ogv-hau.." (not showing full name here), which is the problem.
  3. When the installation routine tries to set up the database structure, it throws an error like:
    SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-hau...' at line 1

I tried the same setup but without the hyphen in the database's name --> works.
This means Anchor cannot deal with hyphens in SQL syntax.
I would say using brackets for those names would solve the issue, no?

--Edit:
After installing Anchor with a database without hyphens in its name and afterwards renaming the database to have hyphens in its name and editing the name in anchor/config/db.php manually actually works. The issue therefore is only installation-related.

Context details (if applicable)

  • Anchor version: 0.12.7
  • Server setup: PHP 7.2, MySQL 5.6
  • URL
@CraigChilds94
Copy link
Member

@dhilleCZ

Thanks for spotting this one!

@veryard
Copy link
Contributor

veryard commented Apr 1, 2019

Made a pull request with a fix for the installer.

#1309

@veryard
Copy link
Contributor

veryard commented Apr 4, 2019

I assume this can be closed now? @CraigChilds94

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Current Version
  
Awaiting triage
Development

No branches or pull requests

2 participants