MySQL Questions and Answers – Internal Security: Preventing Unauthorized Filesystem Access

This set of MySQL online test focuses on “Internal Security: Preventing Unauthorized Filesystem Access”.

1. To check if the data directory contains insecure files or directories, the command executed is _____________
a) ls -l
b) ls -a
c) ls -la
d) ls -lu
View Answer

Answer: c
Explanation: It can be determined whether the data directory contains insecure files or directories by executing ‘ls -la’. Then the lookup for files or directories that have the “group” or “other” permissions turned on.

2. What enables the read and execute access to all users outside of mysql group.
a) drwxrwxr-x
b) drwxrwxr-y
c) drwyrwyr-x
d) drwyrwyr-y
View Answer

Answer: a
Explanation: Some database directories have the proper permissions like ‘drwx——‘ enables read, write, and execute access to the owner, but no access to anyone else. Other directories have an overly permissive access mode like ‘drwxrwxr-x’.

3. The server uses a Unix domain socket file for connections by clients to localhost.
a) True
b) False
View Answer

Answer: a
Explanation: The server uses a Unix domain socket file for connections by clients to localhost. The socket file normally is publicly accessible so that client programs can use it again properly.
advertisement
advertisement

4. Which program is used as a utility for MyISAM table maintenance?
a) innochecksum
b) myisam_ftdump
c) myisamchk
d) myisamlog
View Answer

Answer: c
Explanation: The program ‘myisamchk’ is a utility for the table maintenance. ‘innochecksum’ is used for offline InnoDB file checksum utility. To display full text index information ‘myisam_ftdump’ is used.

5. What does the AUTO_INCREMENT sequences normally begin at?
a) 0
b) 1
c) -1
d) 2
View Answer

Answer: b
Explanation: The AUTO_INCREMENT column attribute provides unique numbers for column identification. AUTO_INCREMENT sequences normally begin at 1 and increase monotonically like 1, 2, 3, and so on.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. How can the value of recently generated sequence number be obtained?
a) LAST_INSERT_ID()
b) LATEST_INSERT_ID()
c) INITIAL_INSERT_ID()
d) INSERT_ID()
View Answer

Answer: a
Explanation: The value of most recently generated sequence number can be obtained by calling the LAST_INSERT_ID() function. This enables to reference the AUTO_INCREMENT value in the subsequent statement.

7. What does LAST_INSERT_ID() return when no AUTO_INCREMENT value has been generated during the current connection?
a) -1
b) 0
c) 1
d) 2
View Answer

Answer: b
Explanation: The ‘LAST_INSERT_ID()’ function returns zero when no ‘AUTO_INCREMENT’ value has been generated during the current connection with the server. It is tied to the current connection.
advertisement

8. Triggers are not supported for _____________
a) delete
b) update
c) insert
d) views
View Answer

Answer: d
Explanation: In MySQL, the triggers are run only after the table modifications like insert, update and delete are run. Triggers are not supported for views. In order to create a trigger, the CREATE TRIGGER statement is used.

9. Triggers and events are not invoked automatically by the server.
a) True
b) False
View Answer

Answer: b
Explanation: The triggers and events are invoked automatically by the server, so the concept of invoking user is not applied. Thus, they have no SQL SECURITY characteristic and always execute with definer privileges.
advertisement

10. How is a stored procedure invoked?
a) INVOKE
b) SEE
c) CALL
d) RETURN
View Answer

Answer: c
Explanation: In MySQL, a stored procedure is invoked using the CALL statement. A stored procedure does not have a return value but can modify its parameters. It also returns some result sets.

Sanfoundry Global Education & Learning Series – MySQL Database.

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

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

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.