class MysqlAdapter
Ruby on Rails 4.0.13
Since v3.1.12 Last seen in v4.2.9The 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:defaultto 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.
Inherits from
Namespace
Modules
Classes
Constants
Methods (defined here)
- # active?
- # clear_cache!
- # client_encoding
- # disconnect!
- # exec_delete
- # exec_query
- # exec_update
- # execute_and_free
- # last_inserted_id
- # reconnect!
- # reset!
- # select_rows
- # supports_statement_cache?
- # type_cast
- self. new
Private methods
(6)
Implementation detail — not part of the public API.
- # configure_connection
- # connect
- # exec_stmt
- # select
- # set_field_encoding
- # version