Mysql2 :: Error Access denied for user 'root' @ 'localhost' (using password: none) ruby ​​on rails

I installed Ruby on Rails 4.2 on Ubuntu successfully and use MySQL as my database, but when I want to see the new application that I created in the browser using localhost: 3000

I get this error message:

Mysql2::Error
Access denied for user 'root'@'localhost' (using password: NO)

Extracted source (around line #70):


        socket = socket.to_s unless socket.nil?

70      connect user, pass, host, port, database, socket, flags
      end

      def self.default_query_options

Any help?

+4
source share
1 answer

I installed Ruby 2.2, ROR 4.2.0, mysql server 5.6 on my Mac OS 10.9 and tested my first ROR application. The Rails application uses the sqlite3 database by default, and this time I'm trying to use mysql.

Here are my steps:

0

All Articles