Skip to content

Instantly share code, notes, and snippets.

@3h5a9
Last active May 15, 2016 12:04
Show Gist options
  • Save 3h5a9/d2be33314ada84ca944e16be281fc45d to your computer and use it in GitHub Desktop.
Save 3h5a9/d2be33314ada84ca944e16be281fc45d to your computer and use it in GitHub Desktop.
Can't connect to local MySQL server through socket
[smehsan@localhost one]$ rake db:create
#<Mysql2::Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13 "Permission denied")>
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>nil, "socket"=>"/var/run/mysqld/mysqld.sock", "database"=>"one_development"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"}
(If you set the charset manually, make sure you have a matching collation)
#<Mysql2::Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13 "Permission denied")>
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>nil, "socket"=>"/var/run/mysqld/mysqld.sock", "database"=>"one_test"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"}
(If you set the charset manually, make sure you have a matching collation)
[smehsan@localhost one]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment