Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Location of database tables - MySQL - Windows XP

Tags:

mysql

All,

This is the first time I am using MySQL and hence listing all the steps. This is actually a reinstall of MySQL since my 1st attempt had failed.

I have installed the latest version of MySQL Community Server on my machine. The installation folder is C:\Program Files\MySQL\MySQL Server 5.5 . The data folder resides in this folder path itself. I have created few tables in the MySQL command prompt by:

1 > Going into MS DOS Prompt.
2 > Making C:\Program Files\MySQL\MySQL Server 5.5 as my current directory
3 > Entered command: mysql -u root -p
4 > Entered password
5 > Placed my script file(.sql) which creates new tables in the folder C:\Program Files\MySQL\MySQL Server 5.5\bin
6 > In the command prompt, typed source <scriptfile>.sql
7 > Now, I get warnings for few tables. But when I enter command SHOW TABLES, all the tables in the script file are shown.

However, I am not able to locate the tables created in form of directories/files on the drive. The data folder does not contain my tables as well.Can anyone please tell me where are the tables located?

like image 782
name_masked Avatar asked Jan 30 '11 14:01

name_masked


People also ask

Where are MySQL tables located?

To use the SHOW TABLES command, you need to log on to the MySQL server first. On opening the MySQL Command Line Client, enter your password. Select the specific database. Run the SHOW TABLES command to see all the tables in the database that has been selected.

Where is the MySQL database stored in Windows?

ini, which store in the MySQL installation folder. 2) Open the “my. ini” with our favor text editor. Find the “datadir”, this is the where does MySQL stored the data in Windows.

How do I view MySQL logs in Windows?

The default location for each of the logs is the MySQL Data directory (C:\ProgramData\MySQL\MySQL Server [version number]\Data\), and the default log names are based on the computer's device name.

How do I find my database in MySQL workbench?

To view the database created on MySQL Workbench, navigate to Database > Connect to Database . Choose an existing connection to connect to MySQL Server or create a new one. The database created will be as shown in the screenshot below.


2 Answers

On Windows 7, the data directory is, by default, "C:/ProgramData/MySQL/MySQL Server 5.5/Data/". Note that "C:/ProgramData" is a hidden directory.

like image 98
Simon Legault Avatar answered Oct 20 '22 00:10

Simon Legault


In windows 8(dont check in other OS)
Enter mysql in command prompt by

mysql -uusername -ppassword

Then type

select @@datadir;
mysql> select @@datadir;
+---------------------------------------------+
| @@datadir                                   |
+---------------------------------------------+
| C:\ProgramData\MySQL\MySQL Server 5.6\data\ |
+---------------------------------------------+
1 row in set (0.00 sec)

Another way!!! Go to C:\ProgramData\MySQL\MySQL Server 5.6\my.ini and there you can find datadir. Be sure it is in ProgramData, not in ProgramFiles.

like image 25
NCA Avatar answered Oct 20 '22 01:10

NCA