How run MySQL dump inside mysql console

Sometimes it may be necessary to use the mysqldump command in the mysql command line. As you know, this command is an external command and must be executed separately, but with the method we teach, you can also use it in the mysql command line.

 

For this purpose, it is enough to use the phrase \!at the beginning of the command.

\! mysqldump -u username -p database > database_dump.sql