mysql提示符下执行操作系统命令(Execute operating system commands from MySQL prompt)



mysql> system df -h;Filesystem            Size  Used Avail Use% Mounted on/dev/mapper/vg_standby-lv_root                       37G   20G   15G  58% /tmpfs                 939M     0  939M   0% /dev/shm/dev/sda1             477M   32M  420M   8% /boot


mysql> system du -sh /mysql/data6.7G    /mysql/data


mysql> system date


At the MySQL prompt, enter system followed by the operating system command to be executed, instead of exiting the MySQL command line and executing the operating system command.

1. View the usage of each file system on the current system:

mysql>  < strong>system   df -h; Filesystem             Size   Used Avail Use% Mounted on/dev/mapper/vg_ standby-lv_ root                        37G    20G    15G   58% /tmpfs                  939M      0   939M    0% /dev/shm/dev/sda1              477M    32M   420M    8% /boot

2. Check the usage of MySQL data directory

mysql> system du -sh /mysql/data6.7G    /mysql/data

3. View the time of the current operating system

mysql> system date