0

I am a new Fedora user and I am installing ROR on my machine.

But when I try to enter the following command rake db:create it shows the following errors.

Can any one please tell me how can I solve this problem.

[smehsan@localhost proone]$ 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"=>"proone_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"=>"proone_test"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"} (If you set the charset manually, make sure you have a matching collation) [smehsan@localhost proone]$ 
3
  • Have you got latest Fedora with all the updates? In Fedora, mysqld.sock is in /var/lib/mysql and not in /var/run/mysqld. It looks like you have mysql2 gem built for different mysql headers. So this means there's something wrong you did before with installing rails, gems and mysql servers and building them against wrong server configurations. Commented May 15, 2016 at 13:54
  • @AndrewSmith thank you. Can you please tell me how can i fix this problem? Commented May 15, 2016 at 18:16
  • Nuke the mysql2 gem and run bundle install again to rebuild it. If that doesn't help, look carefully at your MySQL server configuration. Commented May 16, 2016 at 5:43

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.