I installed rails on mac using Homebrew recently. I fired up the rails server using
rails s but when I visit
localhost:3000, I get the following error .
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) socket = socket.to_s unless socket.nil? connect user, pass, host, port, database, socket, flags end def self.default_query_options
I have googled enough but couldn't find a solution.
I started mysql using mysql.server start . It started. But when I use
mysql -u root, it gives the following error
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) . But in
localhost:3000 it gives this error
Access denied for user 'root'@'localhost' (using password: NO) . And as far as I can remember, I didn't set any password for mysql .