Strictly in terms of MySQL, a Database and a Schema are one and the same.
From the wording of your question
- What you call a single database is really the mysqld server process
- What you call a schema in just an OS subfolder managed by the mysqld process
The way mysqld creates a database is straightforward: It simply makes a subfolder under the current datadir. For example, the default datadir for Linux is /var/lib/mysql. Whenever you execute:
CREATE DATABASE zaver;
It simply executes mkdir /var/lib/mysql/zaver. You can create multiple databases under the mysqld instance. Simply call
CREATE DATABASE zaver1;
CREATE DATABASE zaver2;
CREATE DATABASE zaver3;
When you run SHOW DATABASES;, you will see information_schema (all memory database of MySQL instance metadata), mysql (user grant tables), and tenants created via CREATE DATABASE.
If you want a database in /var/lib/mysql to exist on a different disk, you will have to perform the database creation in the OS.
Suppose you ran the df -h command on you gave this output
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 129G 2.3G 120G 2% /
tmpfs 12G 0 12G 0% /dev/shm
/dev/sdb1 135G 76G 53G 59% /data
/dev/sdc1 135G 188M 128G 1% /backups
Let's say you want to make /data (mounted on /dev/sdb1) the location of the zaver database. Instead of doing CREATE DATABASE zaver; you would do the following:
chown -R mysql:mysql /data
ln -s /var/lib/mysql/zaver /data
chown mysql:mysql /var/lib/mysql/zaver
That's it. The mysqld process will autodetect the presence of the new database.
CAVEAT
Please keep in mind that all tenant databases share usage of three commodities:
- InnoDB Buffer Pool
- MyISAM Key Cache
- Database Connections
If you have some databases that are going to hog resources (RAM, Disk I/O, OS, etc.) that will affect the performance o fother tenants, consider setting up another DB Server to run MySQL for tenants that have condominiums and penthouse needs of server resources.