This set of Tough MySQL Questions and Answers focuses on “Arranging for MySQL Server Startup and Shutdown”.
1. The error log file has a suffix ______________
Explanation: In Windows, by default, the error log is located in the ‘C:\Program Files\MySQL\MySQL Server 5.7\data’ directory. It is the file with a suffix of .err, or may be specified by passing in the ‘–log-error’ option.
2. The option which finds the startup options supported by the server through mysqld is ______________
Explanation: The statement ‘mysqld –verbose –help’ is used for finding out all the startup options that are supported by the server. It is possible to run the server manually or automatically.
3. Server startup can also be done by the ______________
a) option file
b) log file
c) error file
d) system file
Explanation: The options are listed in an option file. Options specified in this way are given one per line. Only the long option form can be used and it is written without the leading dashes.
4. For REVOKE statements, the server automatically rereads the grant tables.
Explanation: For the ‘REVOKE’ and ‘DROP USER’ statements, the server automatically re-reads the grant tables and no FLUSH PRIVILEGES statements are needed. Hence the grant tables are re-read.
5. It is required to have an access privilege for a database before selecting it with ‘USE’.
Explanation: In order to select a database as the default database for the MySQL server using the ‘USE’ statement, some access privilege for the database needs to be granted or attained.
6. The keyword used to create a database is __________
Explanation: The statement ‘CREATE DATABASE database_name;’ is used to create a database with the name ‘database_name’. A database qualifier should be used to specify the full name of the database.
7. Which file is created by the server to store the database attributes?
Explanation: Whenever a database is created in MySQL, the MySQL server creates a directory with the same name as the database. It creates the file db.opt to store the attributes.
8. What is the default storage engine?
Explanation: MySQL comes with multiple storage engines. The default storage engine used is ‘MyISAM’. ‘EXAMPLE’ is the stub storage engine, NDB is the storage engine for MySQL Cluster.
9. The name of the format file for a table named my_tbl is __________
Explanation: Every time a table is created in MySQL, it creates a disk file containing the format of the table. It has two components, namely, base name (here, ‘my_tbl’) and an extension (here, ‘frm’).
10. In the CREATE TABLE statement the engine name specified is case insensitive.
Explanation: Suppose a table is created using the following statement: ‘CREATE TABLE my_tbl (…..) ENGINE = InnoDB;’. The engine name ‘InnoDB’ used is always case insensitive.
Sanfoundry Global Education & Learning Series – MySQL Database.
To practice tough questions and answers on all areas of MySQL, here is complete set of 1000+ Multiple Choice Questions and Answers.