Reputation: 24492
How I can change my /etc/mysql/my.cnf
file and add sql-mode="allow_invalid_dates"
in n y vagrant ssh
command after connecting?
I tried to run vi /etc/mysql/my.cnf
which opens the file, but not option to save it after editing..
Upvotes: 2
Views: 784
Reputation: 53783
You can run a vagrant shell provisioner
Vagrant.configure("2") do |config|
...
config.vm.provision "shell", inline: "echo 'sql-mode=\"allow_invalid_dates\"' >> /etc/sysconfig/configfile"
...
end
This will run it automatically for you
If you want to do from the vm and edit the file yourself, make sure you do as sudo and from vi
do the following:
I'm sure you can find plenty of tutorial on vi
Upvotes: 1