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
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
andSYSTEM_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