Can be either a host name or an IP address. When passing null, the value is retrieved from
mysqli.default_host.
When possible, pipes will be used instead of the TCP/IP protocol.
The TCP/IP protocol is used if a host name and port number are provided together e.g. localhost:3308.
username
The MySQL username or null to assume the username based on the
mysqli.default_user ini option.
password
The MySQL password or null to assume the password based on the
mysqli.default_pw ini option.
database
The default database to be used when performing queries or null.
port
The port number to attempt to connect to the MySQL server or null to assume the port based on the
mysqli.default_port ini option.
socket
The socket or named pipe that should be used or null to assume the socket based on the
mysqli.default_socket ini option.
Note:
Specifying the socket parameter will not
explicitly determine the type of connection to be used when
connecting to the MySQL server. How the connection is made to the
MySQL database is determined by the hostname
parameter.
flags
With the parameter flags you can set different
connection options:
Like MYSQLI_CLIENT_SSL, but disables validation of the provided
SSL certificate. This is only for installations using MySQL Native Driver and MySQL 5.6 or later.
Note:
For security reasons the MULTI_STATEMENT flag is
not supported in PHP. If you want to execute multiple queries use the
mysqli_multi_query() function.
MySQLnd always assumes the server default charset. This charset is sent during connection
hand-shake/authentication, which mysqlnd will use.
Libmysqlclient uses the default charset set in the
my.cnf or by an explicit call to mysqli_options() prior to
calling mysqli_real_connect(), but after mysqli_init().