I am having issues trying to sync my staging server with my local server using drush sql-sync command.

I've set my aliases right and the same configuration is working with my development server and local machine.

Here are the issues I get once I type in:

drush sql-sync @stag @local

I get the standard warning about backing up my target database.

Then I'm having this error:

stdin: is not a tty
mysqldump: unknown variable 'table_cache=67108864'
Database dump failed 

So I am pretty sure this has something to do with MySQL configuration on the staging server.

From what I've googled/read, a large value for the table_cache is not necessarily a good one for the server and can slow it down. But I am not sure what a "good" value is.

| improve this question | | | | |
  • here is the nice documentation about table_cache dev.mysql.com/doc/refman/5.0/en/table-cache.html – shrish Jun 6 '14 at 10:34
  • @sirish, thanks for the link. After a bit more searching around, I found this link. looks like the table_cache should be replaced by table_open_cache after a version 5.1.3... So I replaced it and restarted mysql. No change. – Ram Jun 6 '14 at 12:48

This does look like an issue with mysql, not Drush. Run your Drush command again with the -s flag (simulate);

drush sql-sync @stag @local -s

Drush will then print out the shell commands that it would execute, without doing anything. You can copy the mysqldump command into your shell, and experiment with the options until the dump works.

| improve this answer | | | | |
  • thanks for the tip. Did not know about the simulate flag. – Ram Jun 9 '14 at 6:37
  • One thing I found out while testing issues with mysqldump on the stag server is that it is having issues with the parameters listed under [mysqldump] in my.cnf. So,once I commented out the error variable under mysqldump and ran mysqldump again,the error ends up being the next parameter in the list.(There are around 15-20 parameters under this list) So I tried using mysqldump with the --no-defaults argument which ended up working. Now I need to find a find a way so that sql-sync call can be made using the argument or I probably should comment out all the my.cnf parameters for mysqldump, – Ram Jun 9 '14 at 6:51
  • To anyone that might bother, commenting out the mysqldump config parameters in my.cnf worked for me(for now). Not sure sure if that as the right way to go about it – Ram Jun 10 '14 at 6:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.