Taken from here:
https://github.com/tmtm/ruby-mysql/blob/master/lib/mysql/charset.rb
Author: TOMITA Masahiro <tommy@tmtm.org>
The MySQL adapter will work with both Ruby/MySQL, which is a Ruby-based MySQL adapter that comes bundled with Active Record, and with the faster C-based MySQL/Ruby adapter (available both as a gem and from www.tmtm.org/en/mysql/ruby/).
Options:
-
:host
- Defaults to “localhost”. -
:port
- Defaults to 3306. -
:socket
- Defaults to “/tmp/mysql.sock”. -
:username
- Defaults to “root” -
:password
- Defaults to nothing. -
:database
- The name of the database. No default, must be provided. -
:encoding
- (Optional) Sets the client encoding by executing “SET NAMES <encoding>” after connection. -
:reconnect
- Defaults to false (See MySQL documentation: dev.mysql.com/doc/refman/5.0/en/auto-reconnect.html). -
:strict
- Defaults to true. Enable STRICT_ALL_TABLES. (See MySQL documentation: dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html) -
:variables
- (Optional) A hash session variables to send as `SET @@SESSION.key = value` on each database connection. Use the value `:default` to set a variable to its DEFAULT value. (See MySQL documentation: dev.mysql.com/doc/refman/5.0/en/set-statement.html). -
:sslca
- Necessary to use MySQL with an SSL connection. -
:sslkey
- Necessary to use MySQL with an SSL connection. -
:sslcert
- Necessary to use MySQL with an SSL connection. -
:sslcapath
- Necessary to use MySQL with an SSL connection. -
:sslcipher
- Necessary to use MySQL with an SSL connection.