Skip to content

mysql_connect_file

imshooter edited this page Nov 29, 2026 · 1 revision

Connect to a database with the settings of a file.

The file has a key = value setting on each line: hostname, username, password, database, server_port, auto_reconnect, multi_statements, pool_size, ssl_enable, ssl_key_file, ssl_cert_file, ssl_ca_file, ssl_ca_path and ssl_cipher, and the lower case names of the other E_MYSQL_OPTION values. A value takes ${NAME} from the environment of the server, as password = ${MYSQL_PASSWORD}.

native MySQL:mysql_connect_file(const file_name[] = "mysql.ini");

With open.mp names, from the same include:

native MySQL:MySQL_ConnectFile(const file_name[] = "mysql.ini");

Parameters

Parameter Description
const file_name[] = "mysql.ini" Path of the file. A relative path is looked for in scriptfiles first, then from the folder of the server.

Returns

  • The handle.
  • MYSQL_INVALID_HANDLE when the file cannot be read or has a setting that is not valid.

Home

Guides

Reference

Functions

Connections
Queries
Cache
JSON cells
ORM
Queries built in pieces
Prepared statements
Batches
Transactions
Passwords
Callbacks

Clone this wiki locally