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

后端 未结 4 928
耶瑟儿~
耶瑟儿~ 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:17

    This displays the file location for the UNIX socket:

    mysqladmin version -u 'your user name' -p
    

    result:

    mysqladmin  Ver 8.42 Distrib 5.7.26, for Linux on x86_64
    Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Server version      5.7.26-0ubuntu0.19.04.1
    Protocol version    10
    Connection      Localhost via UNIX socket
    UNIX socket     /var/run/mysqld/mysqld.sock
    Uptime:         6 min 40 sec
    

    Your user must have granted permissions.

提交回复
热议问题