Interacting With MySQL


  1. In UNIX, the name of the option file is __________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Under Unix, an option file is set up by creating a file named ‘~/.my.cnf’ in the home directory. ‘C:\my.ini’ is the option file that is setup in Windows. An option file stores the connection parameters.


  1. The connection parameters for setting up MySQL can be stored in an option file to save typing the names every time a connection is established.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Every Time MySQL is invoked, connection parameters like hostname, username and password are required. To save typing these parameters all the time, they can be saved in an option file instead and executed when setting up the connection.



  1. The clause that enables mapping a short command to a long command is __________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    If the shell program permits an alias, a short command can be mapped to a long command. This reduces the time taken by typing long commands frequently. An alias is defined by the keyword ‘alias’ followed by the short and long commands.


  1. Which option prints output in table-format when MySQL is run interactively?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    MySQL produces output in tab-delimited format when it is run in batch mode. Suppose a table-format output is desired, the -t option is used along with the mysql command. -tf is not a valid option.



  1. To execute the contents of a query file ‘exec.sql’ by feeding it to mysql, which command is used?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    mysql queries can be run after placing the queries in a file, and then executing it by feeding it to mysql. By default, mysql prints output in a tab-delimited format when it is running in noninteractive mode.