MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The SQL command to create a new user with password is:—CREATE USER‘YJChin’@’localhost’ IDENTIFIED BY ‘password123’
A
FALSE
B
TRUE
C
Either A or B
D
None of the above
Explanation: 

Detailed explanation-1: -Create a new MySQL user account mysql> CREATE USER ‘local user”localhost’ IDENTIFIED BY ‘password’; This command will allow the user with username local user to access the MySQL instance from the local machine (localhost) and prevent the user from accessing it directly from any other machine.

Detailed explanation-2: -CREATE USER ‘nativeuser”localhost’IDENTIFIED WITH mysql native password BY ‘password’; Next, if you run MySQL locally you can modify your my. cnf file by adding the line shown below and restarting your MySQL service. This will validate all database users (including root) using mysql native password authentication.

There is 1 question to complete.