DataBase/MySQL

[MySQL] MySQL에서 shell command 사용하기

효락 2017. 11. 9. 18:05

MySQL 에서 OS 로 shell command를 실행하기 위해서는" \! " 명령어를 사용하면 된다.


mysql> \! ls -al
mysql> \! ls -al
합계 986368
dr-xr-x---.  4 root root       4096 11월  8 16:45 .
dr-xr-xr-x. 17 root root        224 10월 31 16:56 ..
-rw-------.  1 root root       2137 11월  8 14:15 .bash_history
-rw-r--r--.  1 root root         18 12월 29  2013 .bash_logout
-rw-r--r--.  1 root root        176 12월 29  2013 .bash_profile
-rw-r--r--.  1 root root        176 12월 29  2013 .bashrc
-rw-r--r--.  1 root root        100 12월 29  2013 .cshrc
-rw-------.  1 root root       1923 11월  8 16:45 .mysql_history
...
...