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

ERROR 1064 (42000) at line 1: You have an error in your SQL syntax #18

Open
craigmdennis opened this issue Aug 1, 2014 · 9 comments
Open

Comments

@craigmdennis
Copy link

When I run the task I get the following error:

ERROR 1064 (42000) at line 1: 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 'bash: -c: line 0: syntax error near unexpected token `)'
bash: -c: line 0: `mysq' at line 1

Not sure if this is due to my system configuration or the plugin.

The error appears in the the staging .sql dumps but the grunt task says everything completes successfully. So it fails silently unless you add the flags --verbose --debug when calling the command.

The local db dump file shows correct SQL information.

@craigmdennis
Copy link
Author

This is the code from inside the /staging/db_backup.sql
Sensitive information has been removed.

bash: -c: line 0: syntax error near unexpected token `)'
bash: -c: line 0: `mysqldump -h{host} -u{user} -p{password} {database}'

@nhaskins
Copy link

nhaskins commented Sep 2, 2014

Dunno if you solved this one, but I had the same trouble locally (OSX running MAMP)

The Grunt task wasn't able to use 'mysqldump' because it wasn't in my bash profile. If that's the case...

  • edit ~/.bash_profile
  • add the line: PATH="$PATH:/Applications/MAMP/Library/bin/"

this is assuming MAMP is in the default location.

After adding the path line, save/exit/reset terminal. Now you have access to the command anywhere.. so that should put grunt in a position to execute properly.

@craigmdennis
Copy link
Author

I use the built in apache which is already in my bash profile. Haven't solved this yet.

@nhaskins
Copy link

nhaskins commented Sep 2, 2014

Hrm, does it get as far as generating a .sql file in your backup folder? If so, what does that file contain?

@craigmdennis
Copy link
Author

I get the following error in terminal

Pulling database from 'Staging' into Local
>> Creating DUMP of remote database
>> Database DUMP succesfully exported to:
>> backups/staging/20140902/15-46-08/db_backup.sql
>> Adapt the database: set the correct urls for the destination in the database.
>> Creating DUMP of local database
>> Database DUMP succesfully exported to:
>> backups/local/20140902/15-46-08/db_backup.sql
>> Importing DUMP into local database
Warning: Using a password on the command line interface can be insecure.
ERROR 1064 (42000) at line 1: 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 'bash: -c: line 0: syntax error near unexpected token `)'
bash: -c: line 0: `mysq' at line 1
>> Database imported succesfully

The local backup contains a full SQL dump but the remote backup contains

bash: -c: line 0: syntax error near unexpected token `)'
bash: -c: line 0: `mysqldump -h{host} -u{user} -p{password} {database}'

Where {host} {user} {password} and {database} are sensitive data.

@nhaskins
Copy link

nhaskins commented Sep 2, 2014

my pull command output looks like this:

Pulling database from 'staging' into Local

Creating DUMP of remote database
Database DUMP succesfully exported to:
backups/staging/20140902/18-00-47/db_backup.sql
Adapt the database: set the correct urls for the destination in the database.
Creating DUMP of local database
Database DUMP succesfully exported to:
backups/local/20140902/18-00-47/db_backup.sql
Importing DUMP into local database
Database imported succesfully

Operations completed

Done, without errors.


What I notice different is yours has a line about 'Warning: Using a password on the command line..." then it throws an error. Can you try suppressing that warning? Maybe that's interfering with the rest of execution. Just a theory.

@craigmdennis
Copy link
Author

How do I suppress it? Is #12 related?

@nhaskins
Copy link

nhaskins commented Sep 3, 2014

@tomvdv
Copy link

tomvdv commented Sep 25, 2014

See #6

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

3 participants