![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Where is the MySQL database gets saved when it is created?
If you want the database location i.e. where it is created in MySQL, you can use system variable @@datadir.
The syntax is as follows
SELECT @@datadir;
The following is the query
mysql> select @@datadir;
Here is the output. The above query returns the location
+---------------------------------------------+ | @@datadir | +---------------------------------------------+ | C:\ProgramData\MySQL\MySQL Server 8.0\Data\ | +---------------------------------------------+ 1 row in set (0.00 sec)
Now reach the above directory in your system. The screenshot of the directory is as follows
Now open the Data folder. The Data folder contains all the databases. The screenshot displaying all the databases is as follows
Now you can check any database folder for the tables. For example, let us see the table names of the ‘sample’ database. The screenshot is as follows
Advertisements