By default , MySQL stores its databases in Debian in the folder /var/lib/mysql . If you go to the internal memory has no more space and want to move the location to external storage media , which is actually pretty easy.

create a folder on the external storage, for example,

mkdir /path-to-mountpoint/mysql/

set the necessary permissions for the folder with

chown -R mysql:mysql /path-to-mountpoint/mysql/

( chown = change owner and by the -R the permissions are set recursively , ie including folders and subfolders )

copy all files from the old directory to the new folder

cp -r /var/lib/mysql/* /path-to-mountpoint/mysql/

adjust the configuration file of MySQL li>

To customize the configuration file open it in a text editor of your choice - such as nano.
The file is a little more complex , but the important part is this