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

Force project naming to comply with MySQL DB naming schema, or convert it #32

Open
fernandocanizo opened this issue Jun 23, 2015 · 1 comment

Comments

@fernandocanizo
Copy link

I decided to test Cody and when asked for a project name I used "codeCms Test" then I got an error on DB creation because you cannot have spaces in MySQL DB names.

This is the relevant output from create_site run:

6) Enter a location for storing documents: doc

{ [Error: ER_PARSE_ERROR: 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 'Test default charset utf8' at line 1]
  code: 'ER_PARSE_ERROR',
  errno: 1064,
  sqlState: '42000',
  index: 0 }
{ [Error: ER_NO_DB_ERROR: No database selected]
  code: 'ER_NO_DB_ERROR',
  errno: 1046,
  sqlState: '3D000',
  index: 0 }
{ [Error: ER_NO_DB_ERROR: No database selected]
  code: 'ER_NO_DB_ERROR',
  errno: 1046,
  sqlState: '3D000',
  index: 0 }
mkdir /home/conan/csoft/test/codycms/codyCms Test/controllers
mkdir /home/conan/csoft/test/codycms/codyCms Test/static
mkdir /home/conan/csoft/test/codycms/codyCms Test/static/css
mkdir /home/conan/csoft/test/codycms/codyCms Test/static/images
mkdir /home/conan/csoft/test/codycms/codyCms Test/static/js
mkdir /home/conan/csoft/test/codycms/codyCms Test/views
/home/conan/csoft/test/codycms/node_modules/cody/bin/create_site.js:131
                        if (err) throw err;
                                       ^
Error: ER_BAD_DB_ERROR: Unknown database 'codyCms Test'

The fix is simple, but you have two options: force appropriate project naming, like npm init does, or let the creator to use any name but convert it so wherever it's used, it has the correct syntax.

I'm inclined for the first option, but it's up to you.

@jcoppieters
Copy link
Owner

Fernando,

thanks for the report.
I’ll try to fix this asap.

Johan.

On 24 Jun 2015, at 00:16, Fernando Lucio Canizo notifications@github.com wrote:

I decided to test Cody and when asked for a project name I used "codeCms Test" then I got an error on DB creation because you cannot have spaces in MySQL DB names.

This is the relevant output from create_site run:

  1. Enter a location for storing documents: doc

{ [Error: ER_PARSE_ERROR: 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 'Test default charset utf8' at line 1]
code: 'ER_PARSE_ERROR',
errno: 1064,
sqlState: '42000',
index: 0 }
{ [Error: ER_NO_DB_ERROR: No database selected]
code: 'ER_NO_DB_ERROR',
errno: 1046,
sqlState: '3D000',
index: 0 }
{ [Error: ER_NO_DB_ERROR: No database selected]
code: 'ER_NO_DB_ERROR',
errno: 1046,
sqlState: '3D000',
index: 0 }
mkdir /home/conan/csoft/test/codycms/codyCms Test/controllers
mkdir /home/conan/csoft/test/codycms/codyCms Test/static
mkdir /home/conan/csoft/test/codycms/codyCms Test/static/css
mkdir /home/conan/csoft/test/codycms/codyCms Test/static/images
mkdir /home/conan/csoft/test/codycms/codyCms Test/static/js
mkdir /home/conan/csoft/test/codycms/codyCms Test/views
/home/conan/csoft/test/codycms/node_modules/cody/bin/create_site.js:131
if (err) throw err;
^
Error: ER_BAD_DB_ERROR: Unknown database 'codyCms Test'
The fix is simple, but you have two options: force appropriate project naming, like npm init does, or let the creator to use any name but convert it so wherever it's used, it has the correct syntax.

I'm inclined for the first option, but it's up to you.


Reply to this email directly or view it on GitHub #32.

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

No branches or pull requests

2 participants