MySQL data directory is most important location in which all MySQL databases are stored. The default data directory is located in the file mysql.lf.
If the out of the space is the issue, then the directory need to be moved another location. Before moving, the database need to be closed. After moving the MySQL configuration file need to be edited. Look for the â€˜datadirâ€™ entry and change the path to the new directory.