Interacting With MySQL
- Suppose run_me.sh is a script file. Which command is used to make it executable?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
The command ‘chmod +x file_name’ makes a script file executable. mysql supports reading from a script file and executing queries from it. Before a script is run, it is necessary for it to be made executable.
- MySQL can be used to execute script files.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
MySQL is capable of reading input from a file in batch mode. This is also known as the non-interactive mode. A lot of typing and time can be saved when commands are stored in a file and executed from a file.
- On UNIX, statements entered in ‘MySQL’ are saved in which file?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Statements entered in ‘MySQL’ are stored in the file named ‘.mysql_history’. This file is located in the home directory itself. The SQL statements can be directly pasted into this file.
- What does Control-_ do in MySQL input editor?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Control-_ undoes the last change that was made. This can be repeated. The mysql input editor has a variety of commands to facilitate editing while providing inputs to the command line itself.
- The command to move the cursor to the beginning of line in MySQL input editor is?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Control-A moves the cursor to the beginning of the line. Ctrl-E moves the cursor to the end of the line. Control-D deletes the character under the cursor whereas Esc-a is not valid.