Answer

问题及解答

在 Shell 下执行 mysql 的 SQL 查询.

Posted by haifeng on 2012-10-08 15:14:19 last update 2012-10-08 15:20:06 | Edit | Answers (0)

[haifeng@arch ~]$ mysql -u user -p -e \'SQL statements;\' database

其中

-u : 指定 mysql 数据库的用户名
-p : 提示输入密码
-e : 执行 sql 查询
database : 指定那个数据库


Reference

http://www.cyberciti.biz/faq/run-sql-query-directly-on-the-command-line/