Module: Rails::Generators::Database::MySqlSocket

Included in:
MariaDB, MySQL
Defined in:
lib/rails/generators/database.rb

Instance Method Summary collapse

Instance Method Details

#hostObject



87
88
89
# File 'lib/rails/generators/database.rb', line 87

def host
  "localhost"
end

#socketObject



73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/rails/generators/database.rb', line 73

def socket
  @socket ||= [
    "/tmp/mysql.sock",                        # default
    "/var/run/mysqld/mysqld.sock",            # debian/gentoo
    "/var/tmp/mysql.sock",                    # freebsd
    "/var/lib/mysql/mysql.sock",              # fedora
    "/opt/local/lib/mysql/mysql.sock",        # fedora
    "/opt/local/var/run/mysqld/mysqld.sock",  # mac + darwinports + mysql
    "/opt/local/var/run/mysql4/mysqld.sock",  # mac + darwinports + mysql4
    "/opt/local/var/run/mysql5/mysqld.sock",  # mac + darwinports + mysql5
    "/opt/lampp/var/mysql/mysql.sock"         # xampp for linux
  ].find { |f| File.exist?(f) } unless Gem.win_platform?
end