问题

软件 >> MySQL
Questions in category: MySQL (MySQL).

在 Shell 下执行 mysql 的 SQL 查询.

Posted by haifeng on 2012-10-08 15:14:19 last update 2012-10-08 15:20:06 | 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/