MySQL Questions and Answers – Securing a New MySQL Installation

This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Securing a New MySQL Installation”.

1. The superuser account of the grant tables in the mysql database is called ______________
a) super
b) prime
c) root
d) leaf
View Answer

Answer: c
Explanation: The root accounts are superuser accounts intended for administrative purposes. The root accounts have the privileges and to delete all the databases and shutting down the server.

2. Which script initializes the data directory during installation?
a) mysql_install_db
b) mysql_install_dbm
c) mysql_init_db
d) mysql_init_dbm
View Answer

Answer: a
Explanation: The data directory is initialized during the installation by ‘mysql_install_db’. If MySQL is installed on Linux from RPM packages then ‘mysql_install_db’ is run automatically.

3. Anonymous accounts have user name ______________
a) root
b) blank
c) super
d) prime
View Answer

Answer: b
Explanation: Anonymous accounts have user name left blank. The main benefit of removing the anonymous user accounts is it significantly simplifies the task of setting up non-anonymous accounts.
advertisement
advertisement

4. For REVOKE statements, the server automatically rereads the grant tables.
a) True
b) False
View Answer

Answer: a
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. What does the default case sensitivity of database and table names depend on?
a) SQL server
b) Server SQL mode
c) Operating system of machine
d) Does not depend on anything
View Answer

Answer: c
Explanation: The default case sensitivity imposes a dependency on the operating system of the machine on which the MySQL server is running. Windows does not treat database and table names as case sensitive unlike Unix.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. The case sensitive among these is ______________
a) Stored function name
b) Stored procedure name
c) Trigger name
d) Event name
View Answer

Answer: c
Explanation: The stored functions and stored procedure names in MySQL are not case sensitive. Event names are also not case sensitive. Unlike the standard SQL, the trigger names in MySQL is case sensitive.

7. The variable used to set table alias names as non case sensitive is ______________
a) lower_case_table_names
b) lower_case_all
c) lower_case_alias
d) lower_case_aliases
View Answer

Answer: a
Explanation: In MySQL, by default the alias names are case sensitive. An alias can hence be specified in any letter case, upper, lower or mixed. If the variable ‘lower_case_table_names’ is non zero, the alias names of tables are not case sensitive.
advertisement

8. The clause that can be used to sort string values according to a specific collation is ______________
a) SORT
b) GROUP
c) FILTER
d) COLLATE
View Answer

Answer: d
Explanation: The ‘COLLATE’ operator can be used to sort the string values according to a specific collation. For example, ‘SELECT col FROM tbl ORDER BY col COLLATE latin1_swedish_ci’ sorts by Swedish collation.

9. The statement used to find out which character sets are available is ______________
a) SHOW CHARACTER SET
b) SHOW COLLATION
c) SHOW CHARACTER SETS
d) SHOW COLLATIONS
View Answer

Answer: a
Explanation: It is simple to determine the character sets and collations that are available in MySQL. ‘SHOW CHARACTER SET’ shows the character sets while ‘SHOW COLLATION’ shows the collations.
advertisement

10. The collations this statement lists are ______________

SHOW COLLATION LIKE 'utf8%'

a) names beginning with utf8
b) names ending with utf8
c) names containing utf8% anywhere
d) names ending in utf8%
View Answer

Answer: a
Explanation: The character set ‘utf8’ is used for the Unicode character set 8. The ‘LIKE’ keyword does the job of narrowing the search space to refer to only those names that begin with ‘utf8’.

Sanfoundry Global Education & Learning Series – MySQL Database.

To practice all areas of MySQL Database, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.