Mysql Error handling


  1. All API calls return a value.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    In MySQL, not all the API calls return a value. The client routine named ‘mysql_close()’ is one that does not. The API calls that return a value are ‘mysql_sqlstate()’, ‘mysql_error()’ etc.


  1. The –protocol value ‘TCP’ runs on which operating systems?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    The connection protocol used by the option ‘–protocol = TCP’ indicates TCP/IP connection to the local or the remote server. Each –protocol value has the set of permissible OS.



  1. The function load_defaults() reads the option files.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    The function named ‘load_defaults()’ reads the option files. It takes four arguments. It does not pick up values from the environment settings. All connection paremeters can be brought to argument vector.


  1. What does mysql_real_connect() return if it fails?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    The function ‘mysql_real_connect()’ must complete successfully before any other API functions that require a valid MYSQL connection handler structure can be executed. It return NULL on failure.



  1. The argument to the function mysql_error() is _______________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    The argument to the API functions ‘mysql_error()’, ‘mysql_errno()’ and ‘mysql_sqlstate()’ is a pointer to the connection handler. These should be called after an error occurs.