Print Current Login User Information

# Introduction In this project, you will learn how to access the MySQL database and obtain information about the current logged-in user and the system user. ## 👀 Preview ```mysql MariaDB [(none)]> SOURCE /home/labex/project/currentUser.sql; +----------------+----------------+ | CURRENT_USER() | SYSTEM_USER() | +----------------+----------------+ | root@localhost | root@localhost | +----------------+----------------+ 1 row in set (0.000 sec) ``` ## 🎯 Tasks In this project, you will learn: - How to access the MySQL database using the `sudo` command without a password - How to use the `CURRENT_USER` and `SYSTEM_USER` functions to retrieve user information - How to save the SQL script to a designated file location ## 🏆 Achievements After completing this project, you will be able to: - Understand how to access the MySQL database and execute SQL statements - Retrieve information about the current logged-in user and the system user - Save SQL scripts to a specific file location for future use

|60 : 00

Click the virtual machine below to start practicing