Linux下postgresql忘记密码,以其他用户登录,phpmyadmin默认不允许登录的问题解决
2010-08-04 09:45
906 查看
Postgres允许以linux其他用户在命令行登录的配置:
1.修改/usr/local/pgsql/data目录下的文件pg_hba.conf
local all all ident omicron
2.修改/usr/local/pgsql/data目录下的文件pg_ident.conf 添加
omicron root postgres
3. 重启postgres
执行 /etc/init.d/postgresql restart
4.访问数据库时使用以下命令:
/usr/local/pgsql/bin/psql mydb -U postgres
这里用的是psql的绝对路径,如果是用过系统自动安装的情况,直接psql也是可以的,这个就根据你的系统情况而定了。1,2步骤里的路径也是如此。
Postgres默认不允许phppgadmin登录的问题:
1.修改/var/lib/pgsql/data/pg_hba.conf文件,如下:
#IPV4 local connections
host all all 127.0.0.1/32 md5 ////改为md5认证
2.修改/var/www/html/phppgadmin/conf/config.inc.php
$conf['extra_login_security'] = false; ////改为false
3.执行以下命令,创建postgre用户
#su postgres
$createuser test
输入两次密码....
问你是否将此用户设置为serperuser?选择yes
用户创建成功.
$exit ////切换回root用户
#/etc/rc.d/init.d/postgresql restart ////重启postgre数据库
再次用test用户和密码登陆phppgadmin即可。
修改数据库服务器密码:
以postgres用户执行psql postgres
执行:
ALTER USER postgres WITH ENCRYPTED PASSWORD 'yourpassword'
效果:
-----------------------------------------------------------------------------------------------------------------
Welcome to psql
8.2.6, the PostgreSQL interactive terminal.
Type: /copyright for
distribution terms
/h for help with SQL commands
/? for help with psql
commands
/g or terminate with semicolon to execute query
/q to
quit
postgres=# ALTER USER postgres WITH ENCRYPTED
PASSWORD 'yourpassword';
ALTER ROLE
postgres=#
------------------------------------------------------------------------------------------------------------------
以上内容分别来自于以下地址:
http://hi.baidu.com/luna_kiss_moon/blog/item/f57ba70ec71c8eeb37d12226.html http://www.xxlinux.com/linux/article/development/database/20070919/9818.html http://www.hacms.com/html/2010/0308/34551.html
1.修改/usr/local/pgsql/data目录下的文件pg_hba.conf
local all all ident omicron
2.修改/usr/local/pgsql/data目录下的文件pg_ident.conf 添加
omicron root postgres
3. 重启postgres
执行 /etc/init.d/postgresql restart
4.访问数据库时使用以下命令:
/usr/local/pgsql/bin/psql mydb -U postgres
这里用的是psql的绝对路径,如果是用过系统自动安装的情况,直接psql也是可以的,这个就根据你的系统情况而定了。1,2步骤里的路径也是如此。
Postgres默认不允许phppgadmin登录的问题:
1.修改/var/lib/pgsql/data/pg_hba.conf文件,如下:
#IPV4 local connections
host all all 127.0.0.1/32 md5 ////改为md5认证
2.修改/var/www/html/phppgadmin/conf/config.inc.php
$conf['extra_login_security'] = false; ////改为false
3.执行以下命令,创建postgre用户
#su postgres
$createuser test
输入两次密码....
问你是否将此用户设置为serperuser?选择yes
用户创建成功.
$exit ////切换回root用户
#/etc/rc.d/init.d/postgresql restart ////重启postgre数据库
再次用test用户和密码登陆phppgadmin即可。
修改数据库服务器密码:
以postgres用户执行psql postgres
执行:
ALTER USER postgres WITH ENCRYPTED PASSWORD 'yourpassword'
效果:
-----------------------------------------------------------------------------------------------------------------
Welcome to psql
8.2.6, the PostgreSQL interactive terminal.
Type: /copyright for
distribution terms
/h for help with SQL commands
/? for help with psql
commands
/g or terminate with semicolon to execute query
/q to
quit
postgres=# ALTER USER postgres WITH ENCRYPTED
PASSWORD 'yourpassword';
ALTER ROLE
postgres=#
------------------------------------------------------------------------------------------------------------------
以上内容分别来自于以下地址:
http://hi.baidu.com/luna_kiss_moon/blog/item/f57ba70ec71c8eeb37d12226.html http://www.xxlinux.com/linux/article/development/database/20070919/9818.html http://www.hacms.com/html/2010/0308/34551.html
相关文章推荐
- 解决忘记用户登录密码的问题
- linux虚拟机不识别用户密码,无法登录问题解决
- 解决mac用户忘记登录密码问题
- 一招解决linux不能登录或是忘记密码的问题
- linux下开启SSH,并且允许root用户远程登录,允许无密码登录
- 【Linux使用及问题解决】用户登录时显示 -bash-4.2$ 问题
- 解决免安装版Mysql出现任何用户不用密码都能登录的问题
- 解决Fedora忘记root密码及添加root用户问题
- 一步一步SharePoint 2007之十八:解决允许使用简单密码注册用户的问题
- Redhat Enterprise Linux忘记密码解决方法(也适用于其他linux版本)
- 解决:登录失败,用户账号限制。可能的原因包括不允许空密码,登录时间限制,或强制的策略限制
- linux下mysql 使用mysql -uroot -p输入密码无法登录问题的解决
- 解决Linux系统安装后,root用户无法登录,提示“无法验证用户”的错误问题
- Linux下只允许root登录禁止其他用户登录
- [转]解决VMware中windows2003登录密码忘记的问题
- 【Linux使用及问题解决】用户登录时显示 -bash-4.2$ 问题
- Linux下XAMPP装完之后,Navicat无法连上数据库的问题的解决 注意'mypassword'是当前的mysql登录密码
- 解决Linux中ROOT用户删除普通用户报普通用户已登录问题
- 一步一步SharePoint 2007之十八:解决允许使用简单密码注册用户的问题
- linux里解决phpmyadmin无法登录问题