0

I'm trying to locate data folder of mysql server 5.7

When I run this query

SHOW GLOBAL VARIABLES LIKE 'datadir';

I got my data dir path, but when I actually go there in c drive its not there.

Checked all hidden properties, all are fine.

Any help ?

2
  • What version of Windows? Commented Jan 6, 2016 at 12:01
  • Thanks. It probably doesn't exist yet. Check the answer from @Haralami... Commented Jan 6, 2016 at 12:08

2 Answers 2

2

It could be hidden. Default datadir on Windows 10 is C:\ProgramData which is normally hidden.

Sign up to request clarification or add additional context in comments.

Comments

1

This link describes initializing the data directory on Windows or UNIX-like OSs.

For Windows

Because you have problems with finding the data directory I suggest you define it yourself.

First you have to make sure the following lines are in my.ini file:

[mysqld]
basedir=C:\\Program Files\\MySQL\\MySQL Server 5.7
datadir=D:\\MySQLdata # here you could put 

The second line points to your MySQL Server installation. The third line to wherever you want your data directory to be. After saving the file. You could call following command:

C:\> bin/mysqld --defaults-file=C:\my.ini --initialize

With C:\my.ini pointing to your my.ini file. Hope this helps you

4 Comments

am not getting any error that data dir doesn't exists. Can you help me how to do it ?
I have added a more complete explanation
I have added the lines given by you in my-default.ini file which is located at C:\\Program Files\\MySQL1\\MySQL Server 5.7, So that would my basedir ? And new data folder i have created at this path E:\\roy\\MySQLdata, so that would be my data folder right ? So when I start commands on cmd given by you to initialize shows error that bin doesnt exits something like that. Can you help me more ? Its becoming tedious !!
Yeah, sure. You should put the lines I pointed you in my.ini. here is article, where you could find my.ini file Another useful thing to do will be to put --console at the end of the command, so Windows could output direct the error message in the console.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.