Skip to content

Instantly share code, notes, and snippets.

@marceloleiva
Created June 16, 2015 14:23
Show Gist options
  • Save marceloleiva/2fd56f7642a122573e80 to your computer and use it in GitHub Desktop.
Save marceloleiva/2fd56f7642a122573e80 to your computer and use it in GitHub Desktop.
Conectar Django remotamente con MySQL en Vagrant
#/etc/mysql/my.cnf
bind-address = 0.0.0.0
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'db_name',
'USER': 'user_name',
'PASSWORD': 'password',
'HOST': '127.0.0.1',
'PORT': '9306'
}
}
GRANT ALL ON *.* TO 'user_name'@'localhost';
GRANT ALL ON *.* TO 'user_name'@'%';
config.vm.box = "chef/ubuntu-14.04"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.network :forwarded_port, guest: 3306, host: 9306
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment