Description

This function checks whether a valid .my.cnf file exists in the account's home directory.

Examples 




https://hostname.example.com:2087/cpsess###########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=MysqlFE&cpanel_jsonapi_func=has_mycnf_for_cpuser



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Check for a valid .my.cnf file
$check_mycnf = $cpanel->api2(
    'MysqlFE', 'has_mycnf_for_cpuser'
);

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Check for a valid .my.cnf file
my $check_mycnf = $cpliveapi->api2(
    'MysqlFE', 'has_mycnf_for_cpuser',
);

 




cpapi2 --user=username MysqlFE has_mycnf_for_cpuser



{
  "cpanelresult": {
    "apiversion": 2,
    "data": [
      {
        "has_mycnf_for_cpuser": 0
      }
    ],
    "func": "has_mycnf_for_cpuser",
    "event": {
      "result": 1
    },
    "module": "MysqlFE"
  }
}



Parameters

This function does not accept parameters.

Returns

Return TypeDescriptionPossible valuesExample
has_mycnf_for_cpuserBoolean

Whether the account has a valid .my.cnf file.

  • 1 — Has a valid .my.cnf file.
  • 0 — Does not have a valid .my.cnf file.
                0
              
reasonstring

A reason for failure.

This function only returns a reason value if it failed.


A string that describes the error.

This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1