0

What is the difference between following code in accessing mysql by host,socket ?

                    adapter: mysql2  
                    database: chart_development  
                    username: root
                    password: root                      
                    socket: /var/lib/mysql/mysql.sock  
                           vs
                    adapter: mysql2  
                    database: chart_development  
                    username: root
                    password: root                      
                    host: localhost

How to make the rails to work for both things? "host: localhost" is not working for me.Earlier it work fine.so,I am using "socket: /var/lib/mysql/mysql.sock" right now.

kanna
  • 366
  • 2
  • 19

1 Answers1

2

Change

host: localhost

to

host: 127.0.0.1
Salil
  • 46,566
  • 21
  • 122
  • 156