What is the socket declaration for, in Ruby on Rails database.yml?

后端 未结 4 913
耶瑟儿~
耶瑟儿~ 2020-12-31 09:38

What\'s the use of socket declaration in config/database.yml ?

Example code:

staging:
  adapter: mysql
  encoding: utf8
  database: (database)
  pool         


        
4条回答
  •  天涯浪人
    2020-12-31 10:09

    MySQL has two methods of communicating with it on unix-ish systems, tcp/ip and domain sockets. By specifying the socket Rails, or rather the database driver, will use the socket instead of a network connection. It can be quicker to use the socket but YMMV.

    http://dev.mysql.com/doc/refman/5.5/en/connecting.html

提交回复
热议问题