0
0
MySQLquery~10 mins

MySQL installation and setup - Interactive Code Practice

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

Complete the code to check the MySQL server version.

MySQL
SELECT [1]();
Drag options to blanks, or click blank then click option'
ANOW
BVERSION
CUSER
DDATABASE
Attempts:
3 left
💡 Hint
Common Mistakes
Using NOW() returns the current date and time, not the version.
Using USER() returns the current user, not the version.
2fill in blank
medium

Complete the command to start the MySQL server on Linux.

MySQL
sudo systemctl [1] mysql
Drag options to blanks, or click blank then click option'
Astart
Bstop
Crestart
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using stop will turn off the server.
Using status only shows the server status.
3fill in blank
hard

Fix the error in the command to log into MySQL as root user.

MySQL
mysql -u [1] -p
Drag options to blanks, or click blank then click option'
Aadmin
Buser
Croot
Dmysql
Attempts:
3 left
💡 Hint
Common Mistakes
Using admin or user will cause login failure if those users don't exist.
Using mysql as username is incorrect.
4fill in blank
hard

Fill both blanks to create a new MySQL user with password.

MySQL
CREATE USER '[1]'@'localhost' IDENTIFIED BY '[2]';
Drag options to blanks, or click blank then click option'
Anewuser
Bpassword123
Cadmin
Drootpass
Attempts:
3 left
💡 Hint
Common Mistakes
Using root or admin as new user names can cause conflicts.
Leaving password blank will cause errors.
5fill in blank
hard

Fill all three blanks to grant all privileges on a database to a user.

MySQL
GRANT [1] ON [2].* TO '[3]'@'localhost';
Drag options to blanks, or click blank then click option'
AALL PRIVILEGES
Bmydatabase
Cnewuser
DSELECT
Attempts:
3 left
💡 Hint
Common Mistakes
Using SELECT instead of ALL PRIVILEGES limits permissions.
Using wrong database or username causes errors.