Introduction
A small company needs to set up database access for their new marketing team. As the database administrator, you need to create a new user account that will allow the marketing team to view and analyze customer data, but not modify it.
Create Marketing Analyst Access
Tasks
- Connect to MySQL as the root user
- Create a new user named
marketing_analystthat can only connect from localhost - Grant this user permission to view (SELECT) data from all tables in the marketing_db database
- Ensure the user has a secure password
Requirements
- All operations must be performed in the
~/projectdirectory - The username must be exactly
marketing_analyst - The user must only be able to connect from localhost
- The user must only have SELECT privileges on marketing_db
- The password must be at least 8 characters long
Example
After setting up the user correctly, when you check their privileges, you should see output similar to this:
SHOW GRANTS FOR 'marketing_analyst'@'localhost';
+--------------------------------------------------------------------------------------------------------------------------+
| Grants for marketing_analyst@localhost |
+--------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `marketing_analyst`@`localhost` IDENTIFIED BY PASSWORD '*63CC12793CD9D5CB64C4FED01CC3D4DE25848489' |
| GRANT SELECT ON `marketing_db`.* TO `marketing_analyst`@`localhost` |
+--------------------------------------------------------------------------------------------------------------------------+
Summary
In this challenge, you practiced creating a MySQL user with specific access restrictions. The skills demonstrated include creating a user account, setting up connection restrictions, and granting appropriate privileges at the database level. These fundamental security practices are essential for maintaining proper access control in a database system.



