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

在mysql提示符下,输入system后面接要执行的操作系统命令,而不用退出mysql命令行,执行操作系统命令。

1.查看当前系统上各文件系统的使用情况:

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

2.查看mysql数据目录使用情况

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

3.查看当前操作系统的时间

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