0
0
MySQLquery~10 mins

Creating users in MySQL - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a new user named 'alice' with password 'mypassword'.

MySQL
CREATE USER 'alice'@'localhost' IDENTIFIED BY '[1]';
Drag options to blanks, or click blank then click option'
A'admin'
B'password123'
C'mypassword'
D'userpass'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put the password in quotes.
Using a different password than specified.
2fill in blank
medium

Complete the code to create a user 'bob' who can connect from any host.

MySQL
CREATE USER 'bob'@'[1]' IDENTIFIED BY 'secure123';
Drag options to blanks, or click blank then click option'
A127.0.0.1
Blocalhost
C192.168.1.%
D%
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'localhost' limits the user to local connections only.
Using a specific IP restricts connections unnecessarily.
3fill in blank
hard

Fix the error in the code to create user 'carol' with password 'pass123'.

MySQL
CREATE USER 'carol'@'localhost' IDENTIFIED [1] 'pass123';
Drag options to blanks, or click blank then click option'
AIDENTIFIED BY
BBY
CWITH PASSWORD
DPASSWORD
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'WITH PASSWORD' instead of 'BY'.
Omitting the BY keyword.
4fill in blank
hard

Fill both blanks to create a user 'dave' who can connect from '192.168.0.10' with password 'davepass'.

MySQL
CREATE USER 'dave'@'[1]' IDENTIFIED [2] 'davepass';
Drag options to blanks, or click blank then click option'
A192.168.0.10
Blocalhost
CBY
DWITH PASSWORD
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'localhost' instead of the IP address.
Using 'WITH PASSWORD' instead of 'BY'.
5fill in blank
hard

Fill all three blanks to create user 'eve' who can connect from any host with password 'eve123', and grant all privileges on database 'shop'.

MySQL
CREATE USER 'eve'@'[1]' IDENTIFIED [2] '[3]';
GRANT ALL PRIVILEGES ON shop.* TO 'eve'@'[1]';
Drag options to blanks, or click blank then click option'
A%
BBY
Ceve123
Dlocalhost
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'localhost' instead of '%'.
Forgetting to match the host in GRANT statement.
Using wrong keyword after IDENTIFIED.