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
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.
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.
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.
4. Which program is used as a utility for MyISAM table maintenance?
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?
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.
6. How can the value of recently generated sequence number be obtained?
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?
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.
8. Triggers are not supported for _____________
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.
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.
10. How is a stored procedure invoked?
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.