Skip to main content

Generate connection string

Forms a connection string from the passed data

Function GenerateConnectionString(Val Address, Val Base = "", Val Login = "", Val Password = "", Val Port = "3306") Export

ParameterCLI optionTypeRequiredDescription
Address--addrStringIP address or domain name of the server
Base--dbStringName of the database to connect
Login--loginStringMySQL user
Password--passStringMySQL password
Port--portStringConnection port

Returns: String - MySQL database connection string


1C:Enterprise/OneScript code example
    Address  = "127.0.0.1";
Login = "bayselonarrend";
Password = "12we...";
Base = "";

Result = OPI_MySQL.GenerateConnectionString(Address, Base, Login, Password);
    oint mysql GenerateConnectionString \
--addr "127.0.0.1" \
--db "" \
--login "bayselonarrend" \
--pass "***"
Result
"mysql://bayselonarrend:***@127.0.0.1:3306/"