Linux Commands in MySQL
Recently I came across the ability to run Linux commands in the MySQL shell without the need to drop out of the MySQL shell. This can save quite some time in the long run when troubleshooting database performance issues as you do not need to switch shells to run commands.
You can run a standard Linux command in the MySQL shell by prefixing the command with !\
[root@dbserver /]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 7
Server version: 5.5.56-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> \! uptime
15:55:54 up 51 min, 0 users, load average: 0.00, 0.00, 0.00
MariaDB [(none)]> \! grep innodb-log-file-size /etc/my.cnf
innodb-log-file-size = 256
If you have not herd of this feature, hopefully you find it useful!