Open ghost opened 9 years ago
+1
For me that did not work :( I had to use the following to get it to work (escaped double quotes on the -p )...
mysqldump: "mysqldump -h <%= host %> -u<%= user %> -p\"<%= pass %>\" <%= database %>", mysql: "mysql -h <%= host %> -u <%= user %> -p\"<%= pass %>\" <%= database %>",
The correction made it! Thanks.
This solution did not work for me either. I get the error:
'MYSQL_PWD' is not recognized as an internal or external command, operable program or batch file.
Any ideas? I'm running cgywin on Windows 7.
Neocamel-> did you try the solution in my comment?
Yes I did herbie, it didn't work for me either unfortunately.
What DID work for me was tomvdv's solution here: https://github.com/webrain/grunt-wordpress-deploy/pull/6
For anyone having similar DB issues, another thing to check is your DB passwords. Mine had a semicolon in the actual password which was causing issues with the dump. I guess these aren't always properly escaped, something to look for.
This was a problem with grunt-deployments, so was probably not fixed at the time you forked that project.
In at least some versions of MySQL, if you put the DB password on the command line with the -p argument, the first line of the resulting .sql file will be: "Warning: Using a password on the command line interface can be insecure."
When you then try to load this into another DB, it fails because of invalid SQ syntaxL.
A solution is to change the templates as follows:
mysqldump: "MYSQL_PWD=<%= pass %> mysqldump -h <%= host %> -u<%= user %> <%= database %>", mysql: "MYSQL_PWD=<%= pass %> mysql -h <%= host %> -u <%= user %> <%= database %>",