Microsoft SQL Server

The MSSQL could be installed to the machine during its provisioning - the user will be asked a question whether he/she wants to have it.

Alongside with the server the system will get an official SQLSRV ODBC PHP driver which allows using the MSSQL within PHP.

WARNING: the SQLSRV ODBC driver is available only for PHP7+. For PHP 5.6 the sybase package will allow to interact with a MSSQL database via mssql_* functions which were removed in PHP7+.

Usage

Refer to the default configuration for more.

Examples

CLI

sqlcmd -S localhost -U sa -P secur1tY

Upload a database snapshot.

sqlcmd -S localhost -U sa -P secur1tY -d DATABASE_NAME -i /path/to/script.sql -x

PHP 5.6

$connection = mssql_connect('localhost', 'sa', 'secur1tY');

PHP 7+

$connection = sqlsrv_connect('localhost', [
  'Database' => 'parline', 
  'UID' => 'sa', 
  'PWD' => 'secur1tY',
]);

Comments