如果在linux环境的话可以用\!来执行shell命令:
mysql> \! ping localhost;
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.000 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.000 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.000 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.000 ms
64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.000 ms
--- localhost ping statistics ---