MySQL Features
From DreamFactory
(Created page with "MySQL-based databases are the default in xAMP server installs and come with most pre-built DreamFactory installs. The MySQL service type can connect to local or remote MySQL-b...") |
(→Configuration) |
||
Line 7: | Line 7: | ||
==Configuration== | ==Configuration== | ||
− | * host - String. Required. The name of the database host, i.e. localhost, 192.168.1.1, etc. | + | * '''host''' - String. Required. The name of the database host, i.e. localhost, 192.168.1.1, etc. |
− | * port - Integer. Optional. The number of the database host port, internally defaults to 3306. | + | * '''port''' - Integer. Optional. The number of the database host port, internally defaults to 3306. |
− | * database - String. Required. The name of the database to connect to on the given server. This can be a lookup key. | + | * '''database''' - String. Required. The name of the database to connect to on the given server. This can be a lookup key. |
− | * username - String. Optional. The name of the database user. This can be a lookup key. | + | * '''username''' - String. Optional. The name of the database user. This can be a lookup key. |
− | * password - String. Optional. The password for the database user. This can be a lookup key. | + | * '''password''' - String. Optional. The password for the database user. This can be a lookup key. |
− | * default_schema_only - Boolean. Defaults to false. Do not include other schemas/databases on this server regardless of permissions given to the supplied credentials. | + | * '''default_schema_only''' - Boolean. Defaults to false. Do not include other schemas/databases on this server regardless of permissions given to the supplied credentials. |
− | * charset - String. Optional. The character set to use for this connection, internally defaults to utf8. | + | * '''charset''' - String. Optional. The character set to use for this connection, internally defaults to utf8. |
− | * collation - String. Optional. The character set collation to use for this connection, i.e. utf8_unicode_ci | + | * '''collation''' - String. Optional. The character set collation to use for this connection, i.e. utf8_unicode_ci |
− | * timezone - String. Optional. Set the timezone for this connection. | + | * '''timezone''' - String. Optional. Set the timezone for this connection. |
− | * modes - String. Optional. Connection session modes to set. Use comma-delimited string, or set 'strict' below. | + | * '''modes''' - String. Optional. Connection session modes to set. Use comma-delimited string, or set 'strict' below. |
− | * strict - Boolean. Defaults to false. Enable strict session mode. | + | * '''strict''' - Boolean. Defaults to false. Enable strict session mode. |
− | * unix_socket - String. Optional. The name of the socket if socket connection is desired. Do not use with host and port. | + | * '''unix_socket''' - String. Optional. The name of the socket if socket connection is desired. Do not use with host and port. |
− | * options - Object. Optional. A name-value array of driver-specific connection options. | + | * '''options''' - Object. Optional. A name-value array of driver-specific connection options. |
− | * attributes - Object. Optional. A key-value array of attributes to be set after connection. For further information, see http://php.net/manual/en/pdo.setattribute.php. | + | * '''attributes''' - Object. Optional. A key-value array of attributes to be set after connection. For further information, see http://php.net/manual/en/pdo.setattribute.php. |
− | * statements - Array of Strings. Optional. An array of additional SQL statements to run during connection initialization. | + | * '''statements''' - Array of Strings. Optional. An array of additional SQL statements to run during connection initialization. |
Revision as of 16:38, 28 July 2016
MySQL-based databases are the default in xAMP server installs and come with most pre-built DreamFactory installs. The MySQL service type can connect to local or remote MySQL-based servers.
Common Feature Exceptions
Requirements
- PHP extensions mysqlnd (preferred, but mysql will also work) and pdo_mysql are required to be installed (by default with most php installs) or compiled in. Check here for installation help.
Configuration
- host - String. Required. The name of the database host, i.e. localhost, 192.168.1.1, etc.
- port - Integer. Optional. The number of the database host port, internally defaults to 3306.
- database - String. Required. The name of the database to connect to on the given server. This can be a lookup key.
- username - String. Optional. The name of the database user. This can be a lookup key.
- password - String. Optional. The password for the database user. This can be a lookup key.
- default_schema_only - Boolean. Defaults to false. Do not include other schemas/databases on this server regardless of permissions given to the supplied credentials.
- charset - String. Optional. The character set to use for this connection, internally defaults to utf8.
- collation - String. Optional. The character set collation to use for this connection, i.e. utf8_unicode_ci
- timezone - String. Optional. Set the timezone for this connection.
- modes - String. Optional. Connection session modes to set. Use comma-delimited string, or set 'strict' below.
- strict - Boolean. Defaults to false. Enable strict session mode.
- unix_socket - String. Optional. The name of the socket if socket connection is desired. Do not use with host and port.
- options - Object. Optional. A name-value array of driver-specific connection options.
- attributes - Object. Optional. A key-value array of attributes to be set after connection. For further information, see http://php.net/manual/en/pdo.setattribute.php.
- statements - Array of Strings. Optional. An array of additional SQL statements to run during connection initialization.