
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Find MySQL Data Directory from Command Line in Windows
To find the MySQL data directory, we can simply use the variable datadir. Let us see how to use the variable with select statement.
The query is as follows −
mysql> select @@datadir;
Here is the output
+---------------------------------------------+ | @@datadir | +---------------------------------------------+ | C:\ProgramData\MySQL\MySQL Server 8.0\Data\ | +---------------------------------------------+ 1 row in set (0.00 sec)
Now we can reach the directory from the above sample output.
Here is the snapshot that displays the MySQL data directory.
Advertisements