CloudReports
  • Home
  • Linux
  • Web development
  • Javascript
  • SQL
  • Ant Design tutorial
  • QR Code Scanner
No Result
View All Result
  • Home
  • Linux
  • Web development
  • Javascript
  • SQL
  • Ant Design tutorial
  • QR Code Scanner
No Result
View All Result
CloudReports
No Result
View All Result
Home Linux

What is the location of the MySQL databases?

npn by npn
April 24, 2022
in Linux, Web development
Reading Time: 3 mins read
0
What is the location of the MySQL databases?
78
VIEWS
Share on FacebookShare on Twitter
5/5 - (5 votes)

MySQL DBMS database files are saved on a hard drive. All database files are kept in the /var/lib/mysql directory by default. This course, though, can be altered.

This post will teach you how to find out where MySQL database files are located on Ubuntu 20.04.

Where can i find the MYSQL Databases?


All database files are kept in the /var/lib/mysql directory by default. To confirm this, run sudo grep -R ‘datadir’ /etc/mysql/, which will reveal the entire path to the folders where the databases are stored:

ADVERTISEMENT
sudo grep -R 'datadir' /etc/mysql/

If you navigate to the suggested location – /var/lib/mysql – you will find all of the essential files from the databases in the directory. The operation to navigate to the folder must be run as the root user, or else the following error will occur: Permission refused

cd /var/lib/mysql
sudo su
cd /var/lib/mysql
ls -l

You are now aware of the location of the MySQL databases. You may also use the mysqld command with the —verbose and —help parameters to see the file storage path for the databases. This command is comparable to the one that came before it.

mysqld --verbose --help | grep ^datadir

If you need to alter the location of database files, open the MySQL configuration file as root in any text editor. As previously stated, the configuration file in this case is stored in /etc/mysql/mysql.conf.d/mysqld.cnf. The command to modify it will be as follows:

sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

In the opened file, look for the [mysqld] block and a parameter named datadir, where you may provide the preferred location where the databases will be placed. After you’ve set the path, you’ll need to save the changes, shut the text editor, and restart the DBMS with the command:

sudo systemctl restart mysql

Conclusions

In this brief post, we looked at where databases in MYSQL are kept. If necessary, you may also alter the storage directory. Do you have extensive experience with the MySQL database management system (DBMS)? Please share your thoughts in the comments section!

Tags: MySQLmysql database location
Previous Post

How to find the Linux file creation date?

Next Post

Linux’s last command

npn

npn

Next Post
Linux’s last command

Linux's last command

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Categories

  • Android (1)
  • Ant Design tutorial (7)
  • App/Game (2)
  • Javascript (16)
  • Layout and Routing (2)
  • Linux (9)
  • PC & LAPTOP (6)
  • PERSONAL FINANCES (1)
  • React (13)
  • SQL (2)
  • TECHNOLOGY & DIGITAL (7)
  • The Basics (5)
  • Web development (37)

Search

No Result
View All Result
  • About Us
  • Documentation
Together We Learn!

© 2021 Cloudreports - Developer ideas, tips and stories...

No Result
View All Result
  • Home
  • Linux
  • Web development
  • Javascript
  • SQL
  • Ant Design tutorial
  • QR Code Scanner

© 2021 Cloudreports - Developer ideas, tips and stories...