数据库 Mysql PostgreSQL 技巧

MySQL默认的超级管理员是root

连接方法:mysql -u root

默认密码为空

修改密码的方法:mysqladmin -u root password 'new password'

PostgreSQL默认的超级管理员密码是postgres
连接方法:psql -U postgres(注意,是大写的-U)
默认密码为空

1)修改数据 目录下 的pg_hba.conf 配置文件

<!-- lang: shell -->
# IPv4 local connections:
host    all             all             127.0.0.1/32          trust

即将 md5 改成 trust

2)然后用这样的命令来修改密码:
修改密码的方法是,用psql登入管理:psql -U postgres


ALTER  USER  postgres WITH password 'new password'`

查看帮助

mysql >Help show
PostgreSQL > \help

你可能感兴趣的:(数据库 Mysql PostgreSQL 技巧)