Can't find the data directory in MySQL!

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 5645 Views - Last Post: 30 September 2011 - 01:18 PM

#1 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

Can't find the data directory in MySQL!

Posted 30 September 2011 - 11:29 AM

Hi, I recently installed MySQL 5.5, and created a database and populated it with tables and data. However I cannot find any trace of these data in the data directory, even though the querying and updating in the MySQL client window works alright, suggesting that the data is okay, but I can't find it. Now the [mysqld] section in the my.ini file says that the path to the database root is datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/". However there is no directory such as ProgramData under the C drive. There is one data directory under the MySQL folder, and it in turn contains two folders, mysql and performance_schema. Each contains a series of MYI, MYD and frm files, but the ones I am looking for, like Teams.MYD, Teams.MYI, Teams.frm (Teams is one of the many tables I have set up in the database Tennis) aren't there. Can anyone tell me where can I find those files?

Is This A Good Question/Topic? 0
  • +

Replies To: Can't find the data directory in MySQL!

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9187
  • View blog
  • Posts: 34,489
  • Joined: 12-June 08

Re: Can't find the data directory in MySQL!

Posted 30 September 2011 - 11:50 AM

Exactly why are you trying to interact with the tables in the file format?

That seems exceedingly... dangerous.
Was This Post Helpful? 0
  • +
  • -

#3 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

Re: Can't find the data directory in MySQL!

Posted 30 September 2011 - 12:06 PM

No no, I am not trying to tinker with them, I am just trying to locate them. I am reading the book MySQL by Paul Dubois, and it contains a chapter named Data Directory, where I found these things. Then I tried to locate where they are, and I couldn't. Please tell me how can I locate them.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9187
  • View blog
  • Posts: 34,489
  • Joined: 12-June 08

Re: Can't find the data directory in MySQL!

Posted 30 September 2011 - 12:10 PM

Look for the my.ini in the main mysql folder.. and for line with the 'datadir' location. They are there. More likely wrapped up in another file though and not overtly named.
Was This Post Helpful? 0
  • +
  • -

#5 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

Re: Can't find the data directory in MySQL!

Posted 30 September 2011 - 12:12 PM

Please read the question I posted. I clearly mentioned that the my.ini file gives a datadir location which doesn't exist.
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9187
  • View blog
  • Posts: 34,489
  • Joined: 12-June 08

Re: Can't find the data directory in MySQL!

Posted 30 September 2011 - 12:18 PM

What OS is this?
Was This Post Helpful? 0
  • +
  • -

#7 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

Re: Can't find the data directory in MySQL!

Posted 30 September 2011 - 12:25 PM

Windows 7. I am providing two images, one of the location of the MySQL folder in C drive, another its contents. Then you might be able to help me.

Attached image(s)

  • Attached Image
  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#8 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9187
  • View blog
  • Posts: 34,489
  • Joined: 12-June 08

Re: Can't find the data directory in MySQL!

Posted 30 September 2011 - 12:30 PM

Naw, google helped. Second hit when I googled "C:\ProgramData\Mysql".

http://dev.mysql.com...leshooting.html

Quote

C:\ProgramData\Mysql on Windows 7 and Windows Server 2008. The C:\ProgramData diectory is hidden by default. You need to change your folder options to see the directory and contents.

Was This Post Helpful? 1
  • +
  • -

#9 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

Re: Can't find the data directory in MySQL!

Posted 30 September 2011 - 12:37 PM

However, I didn't properly understand what they are saying. they are asking me to change the datadir location in the my.ini file. How do I do that, when the file itself is not to be found anywhere? Plus if I set the file location to a new one, won't that create problems while querying and stuff?
Was This Post Helpful? 0
  • +
  • -

#10 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9187
  • View blog
  • Posts: 34,489
  • Joined: 12-June 08

Re: Can't find the data directory in MySQL!

Posted 30 September 2011 - 12:41 PM

Okay - we established you did find the hidden folder, right?

Quote

Plus if I set the file location to a new one, won't that create problems while querying and stuff?

One would assume yes (with any able in that data file currently created).

Quote

However, I didn't properly understand what they are saying.

You and me are in the same boat. I do not own this book nor have I read it. I am unclear on the context of why the author is calling for alteration of the data directory listing.
Was This Post Helpful? 1
  • +
  • -

#11 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

Re: Can't find the data directory in MySQL!

Posted 30 September 2011 - 12:44 PM

No no, I am not talking of the book! I am talking about the contents of the page you gave me the link to. Scroll down to see the section as I have shown in the image below. If I chane the datadir location to say C:/MySQL/data/, then how can I move the contents of the existing MySQL data directory before restarting the MySQL server?

Attached image(s)

  • Attached Image

This post has been edited by cupidvogel: 30 September 2011 - 12:45 PM

Was This Post Helpful? 0
  • +
  • -

#12 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9187
  • View blog
  • Posts: 34,489
  • Joined: 12-June 08

Re: Can't find the data directory in MySQL!

Posted 30 September 2011 - 12:48 PM

Woah..woah..woah. Why are you doing that? I was just merely citing a source that indicates the folder is hidden. The relevant text was quoted, and I wasn't using it as a reason to read further.
Was This Post Helpful? 0
  • +
  • -

#13 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

Re: Can't find the data directory in MySQL!

Posted 30 September 2011 - 12:49 PM

But I want to unhide it, and see its contents. Pray help.
Was This Post Helpful? 0
  • +
  • -

#14 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9187
  • View blog
  • Posts: 34,489
  • Joined: 12-June 08

Re: Can't find the data directory in MySQL!

Posted 30 September 2011 - 12:51 PM

Ah yeah. It's a windows folder setting.
http://windows.micro...ow-hidden-files

"Pray help" - wth?!
Was This Post Helpful? 1
  • +
  • -

#15 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

Re: Can't find the data directory in MySQL!

Posted 30 September 2011 - 12:57 PM

Oh ho, I knew this, just thought that maybe the MySQL installation does some nasty things with this folder and merely showing hidden folders options won't do the thing. Thank you so much for hearing my prayer! :online2long:
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2