How can clone database in mariadb prompt character?
General answer - No!

First of all - mysqldump it is not a simple sql command, this is
    complicated logic behind it, such as:
 - show definition of all objects - tables, routings, foreign keys
 - manage export import in proper order, like disable constraints and etc

Second (in addition to first) - mysql console (and SQL as language) do not support database level commands, like select all - You would need do this for each tables, objects, routines.

Federated engine (FederatedX) also not resolve "problem"