where is my database saved when I create it in MySQL?

Viewed 25807

I'm completely new to ubuntu and MySQL and I created a new database via:

mysql -u root -p
create database mydb;

Now, in which directory is this database saved and how do I specify where it's saved when I create it?

6 Answers

run this query

select @@datadir;

this will result somthing like this /var/lib/mysql

First you have to enable to show hidden Items (then open ProgramData). The go to "C:\ProgramData\MySQL\MySQL Server 8.0\Data"

Related