Challenge - 5 Problems
User Creator Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate2:00remaining
What is the result of this user creation query?
Consider the following MySQL command:
What will be the result after running this command?
CREATE USER 'alice'@'localhost' IDENTIFIED BY 'mypassword';What will be the result after running this command?
MySQL
CREATE USER 'alice'@'localhost' IDENTIFIED BY 'mypassword';
Attempts:
2 left
💡 Hint
Think about what the '@' symbol means in MySQL user creation.
✗ Incorrect
The command creates a user 'alice' who can connect only from 'localhost' with the specified password. The password is stored securely by MySQL internally.
📝 Syntax
intermediate2:00remaining
Which option has the correct syntax to create a user with host wildcard?
You want to create a user 'bob' who can connect from any host. Which command is syntactically correct?
Attempts:
2 left
💡 Hint
The '%' symbol is used as a wildcard for hosts in MySQL.
✗ Incorrect
Option B uses the correct syntax with '%' as a wildcard for any host. Other options have invalid host specifications or misplaced parts.
🔧 Debug
advanced2:00remaining
Why does this user creation command fail?
Given the command:
Why does this command fail?
CREATE USER 'carol'@'localhost' IDENTIFIED WITH mysql_native_password;Why does this command fail?
MySQL
CREATE USER 'carol'@'localhost' IDENTIFIED WITH mysql_native_password;
Attempts:
2 left
💡 Hint
Check the syntax for IDENTIFIED WITH in MySQL user creation.
✗ Incorrect
The IDENTIFIED WITH clause requires specifying the authentication plugin and the password or authentication string. Omitting the password causes a syntax error.
🧠 Conceptual
advanced2:00remaining
What does the host part in a MySQL user account specify?
In MySQL, user accounts are defined as 'username'@'host'. What does the 'host' part control?
Attempts:
2 left
💡 Hint
Think about network connections and security.
✗ Incorrect
The 'host' part restricts the machines or IP addresses from which the user can connect to the MySQL server.
❓ optimization
expert3:00remaining
Which command efficiently creates multiple users with the same password?
You want to create three users: 'dave', 'eve', and 'frank', all connecting from any host, with the password 'pass123'. Which command is the most efficient and valid?
Attempts:
2 left
💡 Hint
MySQL allows creating multiple users in one command by listing them with hosts.
✗ Incorrect
Option D correctly creates multiple users with hosts and a shared password in one command. Option D is valid but less efficient. Option D has syntax errors. Option D uses IDENTIFIED BY PASSWORD incorrectly with a plain password.