[Fiware-tech-help] [FI-WARE-JIRA] (SEC-33) CLONE - [Chp - Security][Identity Management] Default database names

Bitergia Team (JIRA) fiware-security-jira at fi-ware.org
Fri Oct 31 15:33:12 CET 2014


    [ http://jira.fi-ware.org/browse/SEC-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055#comment-13055 ] 

Bitergia Team commented on SEC-33:
----------------------------------

The fix adds single quote characters (') around the db_name on the create database example. However, this change won't fix the issue. The problem is that the database.yml example file uses database names with the dash character (\-) on it. Surrounding the database name with the single quote character will raise the same error as not using any quotes at all. The only solution is to use the backtick character (`) instead of the single (or double) quote character. See the following examples:

* No quoting:
{quote}
mysql> create database my-database-name;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-database-name' at line 1
{quote}

* Using single quotes:
{quote}
mysql> create database 'my-database-name';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''my-database-name'' at line 1
{quote}

* Using double quotes:
{quote}
mysql> create database "my-database-name";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"my-database-name"' at line 1
{quote}

* Using backtick:
{quote}
mysql> create database `my-database-name`;
Query OK, 1 row affected (0.09 sec)
{quote}

Another alternative solution is to modify the database names found on the database.yml example file to remove the dash character (\-) from those names.


> CLONE - [Fiware-tech-help] [Chp - Security][Identity Management] Default database names
> ---------------------------------------------------------------------------------------
>
>                 Key: SEC-33
>                 URL: http://jira.fi-ware.org/browse/SEC-33
>             Project: Chp - Security
>          Issue Type: Bug
>          Components: Identity Management
>            Reporter: FIWARE-TECH-HELP
>            Assignee: Álvaro Alonso
>
> When using the default database names provided in the
> database.example.yml configuration file, the create database mysql
> command must enclose the database name within backtick characters (`)
> or mysql will raise an error like this:
>   mysql> create database fi-ware-idm_development;
>   ERROR 1064 (42000): You have an error in your SQL syntax; check the
> manual that corresponds to your MySQL server version for the right
> syntax to use near '-ware-idm_development' at line 1
>   mysql> create database 'fi-ware-idm_development' ;
>   ERROR 1064 (42000): You have an error in your SQL syntax; check the
> manual that corresponds to your MySQL server version for the right
> syntax to use near ''fi-ware-idm_development'' at line 1
> Enclosing the name in backtick characters avoids this problem:
>   mysql> create database `fi-ware-idm_development` ;
>   Query OK, 1 row affected (0.00 sec)
> Please, add backticks to the create database example available on the document.
> _______________________________________________
> Fiware-tech-help mailing list
> Fiware-tech-help at lists.fi-ware.org
> https://lists.fi-ware.org/listinfo/fiware-tech-help



--
This message was sent by Atlassian JIRA
(v6.1.7#6163)



More information about the Fiware-tech-help mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy