pg数据库命令行执行sql语句
D:\Program Files (x86)\PostgreSQL\9.6\bin>psql -d thematic_xjlf -h 192.168.0.164 -p 5432 -U postgres -c "select * from ctrl_area "
mysql数据库命令行执行sql语句
mysql -uroot -proot -h192.168.0.217 -P6001 连接数据库
select * from ruoyi.sys_user; 直接执行sql (注意sql语句要以分号结尾)
use ruoyi 选择数据库
select * from sys_user; 执行sql (注意sql语句要以分号结尾)
MYSQL 与 PostgreSQL 在命令行中执行SQL语句
原文:https://www.cnblogs.com/zt2710/p/14605343.html