
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
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
- Related Articles
- Where Is Low Pressure Region Created ?
- Where is an object stored if it is created inside a block in C++?
- When Ag is exposed to air it gets a black coating of
- Problem with scanf() when there is fgets()/gets()/scanf() after it in C
- Where does MySQL store database files?
- What was the name of JavaScript when it was created?
- Name the energy currency in the living organisms. When and where is it produced?
- Finding code where admin user is created in SAP Hybris
- Why is the closing of a dandelion flower at dusk (when it gets dark), not a tropism?
- What is sieving? Where it is used?
- What is winnowing? Where is it used?
- When a thread is created and started, what is its initial state?
- Where did plant gets nitrogen
- Disable the underlying window when a popup is created in Python TKinter
- Is it necessary to select the database each time we begin a MySQL session?\nHow can it be done?

Advertisements