After ubuntu18 installs mysql, where is the data directory

After installing MySQL on Ubuntu 18, the default data directory is located at  /var/lib/mysql. You can confirm the location of the MySQL data directory with the following command:

sudo mysql -u root -p -e "SHOW VARIABLES LIKE 'datadir';"

After entering the password, the command will output the location of the MySQL data directory. The location of the data directory may be different if you made customizations when installing MySQL.

Guess you like

Origin blog.csdn.net/m0_69057918/article/details/131291743