Settings | Sign in | Sign up

There are currently 3 posts.

PSQL的查看所有数据库,数据表以及use命令

Floor 1 巨大八爪鱼 8/9/14 22:42
mysql:show databases
pgsql:\l 或者\l+(显示的信息要多一些)

mysql:use xx
pgsql:\c xx

mysql:show tables
pgsql:\dt
Floor 2 巨大八爪鱼 8/9/14 22:42
http://zhidao.baidu.com/link?url=WAwAzfDxAVSf8uhBa0V7W6RrmMMWQkphhw9M7jcoavz3QvPZZ3Fh8_fqkGHgej6klNHLF_7xmsPKvnN0OE-xGq
Floor 3 巨大八爪鱼 8/9/14 22:43
3 常用命令 为了便于记忆,这里把对应的mysql命令也列出来了。
(1)列出所有的数据库 mysql: show databases psql: \l或\list (2)切换数据库 mysql: use dbname psql: \c dbname
(3)列出当前数据库下的数据表 mysql: show tables psql: \d
(4)列出指定表的所有字段 mysql: show columns from table name psql: \d tablename
(5)查看指定表的基本情况 mysql: describe tablename psql: \d+ tablename
(6)退出登录 mysql: quit 或者\q psql:\q
http://blog.csdn.net/smstong/article/details/17138355

Content converter:

Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.