Where is the data stored in Mysql 8?

Asked

Viewed 2,475 times

-2

Two days ago I started studying about the Mysql and so far I only know his basics, not to mention that he’s the first SBGD what study.

One very interesting thing about Mysql that I found, is that when creating a database, it does not ask me a directory to save the data just like in sqlite3. It simply receives the instructions I pass and leaves the data somewhere so that it can always be accessed when establishing a connection. And this made me curious to know what is the structure of the folders and files of a database in Mysql.

So my question is: Where and how this data is stored ?

  • 3

    Why are you denying my question ? Could you help me improve the question please leave here in the comments ?

  • I also do not understand these negativities in questions that apparently have nothing wrong. It also occurred to me in a question also of SQL

1 answer

5


All Mysql databases are stored in directories within a DATADIR directory, which is specified in the configuration. Then, a bank called "Bancoapp" would be stored in $DATADIR/Bancoapp.

There are a few ways you can discover this site:

  • If you have access to Mysql, just run the query:

    mysql> select @@dated;

The result of this query will be the database path.

  • If you don’t have access to Mysql, but have access to the server that it is running there are two options:

Linux:

You can check the pro path to date in the process arguments using the command:

$ ps -aux | grep mysql

In Windows, from Vista, the default folder is:

C:\ProgramData\MySQL\MySQL Server %VERSION%\

Browser other questions tagged

You are not signed in. Login or sign up in order to post.