mercredi 5 juillet 2017

Mysql server cannot connect through mysql socket (2) when app is running in vagrant Ubuntu VM

I have a rails app which was perfectly working for me in my default rails development environment, but when I installed Vagrant VM and ran my app on Ubuntu 12.04 I have this error that says

Mysql2::Error (Can't connect to local MySQL server through socket 'MySQL' (2)):

As far as I understood is that my ubuntu VM cannot load Mysql server through socket MYSQL that was working for my default windows, so I tried to remove socket: MySQL line from my rails database.yml

default: &default


adapter: mysql2
  encoding: utf8
  pool: 5
  username: root
  password: xxxxx
  socket: MySQL
  host: localhost

But then I get the error saying my database is not found, I can't seem to fig out how can I look for my database from window and load it in Ubuntu VM ??

here is the log that gives absolutely no info .. :/

Mysql2::Error (Can't connect to local MySQL server through socket 'MySQL' (2)):

/home.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/mysql2-0.4.5/lib/mysql2/client.rb:89:in `connect'
/home.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/mysql2-0.4.5/lib/mysql2/client.rb:89:in `initialize'
/home.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysql2_adapter.rb:25:in `new'
/home.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/ ...so on

Any Ideas on how to make it work ?

Aucun commentaire:

Enregistrer un commentaire