syncCraft
syncCraft copied to clipboard
Sync to Vagrant database
Has anybody gotten syncCraft to work with local vagrant environment.
Based on syncCraft needing mysql path, I went down rabbit hole and added this to my vagrant file:
config.vm.synced_folder "db/", "/var/lib/mysql/craft", disabled: false
It looks promising, but I can't seem to write to DB yet. While none of this is an issue with syncCraft – just wondering if anybody has found a solution.
I fixed this by creating a new variable in my syncCraft.cfg: vagrant_ssh_string=vagrant@yourvagrantIPaddress
Set my mysql path to: mysql_path=mysql
And updating this line with the new variable and ssh call in my local syncCraft.sh:
ssh $ssh_string "mysqldump $remote_db_name --quote-names --opt --hex-blob --add-drop-database -u$remote_db_username -p$remote_db_password" | ssh $vagrant_ssh_string $mysql_path -D$local_db_name -u$local_db_username -p$local_db_password
It may not be specifically a script issue, but I wanted to know if anyone had any advise for this error:
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect