Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashes in mysql database name cause failure on post #36

Open
mooreds opened this issue Feb 25, 2013 · 2 comments
Open

Dashes in mysql database name cause failure on post #36

mooreds opened this issue Feb 25, 2013 · 2 comments
Labels

Comments

@mooreds
Copy link
Contributor

mooreds commented Feb 25, 2013

Using a mysql database with a dash in the name (foo-bar) works with GETs but not with POSTs. I tried putting backticks around the database name in the sql resource file (foo-bar) but that gave this error:

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 'valuation-test``' at line 1

The error when I didn't have backticks indicated that the code was trying to connect to "-bar" (sorry, I don't have the error hanging around.

Workaround: use no dashes in your database name.

@restsql
Copy link
Owner

restsql commented Mar 6, 2013

Neither MySQL 5.5 nor PostgreSQL 9.2 on Windows doesn't allow hyphens in database names. How were you able to create a hyphenated database?

I don't see any code in restSQL that is parsing for hyphens in fully qualified table or column names.

@mooreds
Copy link
Contributor Author

mooreds commented Mar 6, 2013

mysqladmin -u user -ppass create test-database

works fine with mysql 5.1.54 on linux and windows.

I don't have (easy) access to mysql 5.5.

Here's a blog post on creating databases with non alphanumeric characters: http://www.chrisnewland.com/mysql-create-database-with-underscore-or-dash-in-the-database-name-193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants