Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

26 views
Skip to first unread message

Dmitriy

unread,
Jul 9, 2015, 10:47:46 AM7/9/15
to rubyonra...@googlegroups.com
Hi

I installed mysql server on ubuntu 15.04 and gem mysql2

When run command rake db:create display error:

Resque::Helpers will be gone with no replacement in Resque 2.0.0.
Resque::Helpers will be gone with no replacement in Resque 2.0.0.
[WARNING] The git gem requires git 1.6.0.0 or later, but only found 2.1.4. You should probably upgrade.

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>false, "database"=>"bd_development", "pool"=>5, "username"=>"root", "password"=>123, "socket"=>"/tmp/mysql.sock"}, charset: utf8, collation: utf8_unicode_ci
(if you set the charset manually, make sure you have a matching collation)

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>false, "database"=>"bd_test", "pool"=>5, "username"=>"root", "password"=>123, "socket"=>"/tmp/mysql.sock"}, charset: utf8, collation: utf8_unicode_ci


database.yml:

development:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: bd_development
  pool: 5
  username: root
  password: 123
  socket: /tmp/mysql.sock

How can solve this problem? please, help. Thank you





Norm Scherer

unread,
Jul 9, 2015, 11:15:26 AM7/9/15
to rubyonra...@googlegroups.com
look in your mysql configuration file to see where the socket really is, it can vary depending on the system.  Is the mysql server running?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/da6d2a45-d67b-4769-a57a-3c70fc1676be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Walter Lee Davis

unread,
Jul 9, 2015, 7:41:05 PM7/9/15
to rubyonra...@googlegroups.com

On Jul 9, 2015, at 11:14 AM, Norm Scherer <norms...@earthlink.net> wrote:

> look in your mysql configuration file to see where the socket really is, it can vary depending on the system. Is the mysql server running?

You may also get away with deleting the socket line altogether, which will fall back to TCP connection to 127.0.0.1:3306. It's not as fast as a socket, but nearly so.

Walter

Dmitriy

unread,
Jul 10, 2015, 3:24:36 AM7/10/15
to rubyonra...@googlegroups.com
Its was wrong path socket.Thank you!

пятница, 10 июля 2015 г., 2:41:05 UTC+3 пользователь Walter Lee Davis написал:
Reply all
Reply to author
Forward
0 new messages