Postgres SQL 安装

Postgres SQL 安装

我以 root 用户身份安装了 Postgres SQL,并为其创建了用户数据库。我正尝试通过 Linux Redhat 系统从非 root 帐户访问数据库。我安装的软件要求您连接数据库并在网页中提供输出。当我从安装软件的非 root 用户运行 shell 脚本时,它会给出以下输出:

Traceback (most recent call last):
  File "/illumina/apps/galaxy/galaxy-dist/lib/galaxy/webapps/galaxy/buildapp.py", line 35, in app_factory
    app = UniverseApplication( global_conf = global_conf, **kwargs )
  File "/illumina/apps/galaxy/galaxy-dist/lib/galaxy/app.py", line 51, in __init__
    create_or_verify_database( db_url, kwargs.get( 'global_conf', {} ).get( '__file__', None ), self.config.database_engine_options, app=self )
  File "/illumina/apps/galaxy/galaxy-dist/lib/galaxy/model/migrate/check.py", line 50, in create_or_verify_database
    dataset_table = Table( "dataset", meta, autoload=True )
  File "/illumina/apps/galaxy/galaxy-dist/eggs/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/schema.py", line 108, in __call__
    return type.__call__(self, name, metadata, *args, **kwargs)
  File "/illumina/apps/galaxy/galaxy-dist/eggs/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/schema.py", line 236, in __init__
    _bind_or_error(metadata).reflecttable(self, include_columns=include_columns)
  File "/illumina/apps/galaxy/galaxy-dist/eggs/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/engine/base.py", line 1261, in reflecttable
    conn = self.contextual_connect()
  File "/illumina/apps/galaxy/galaxy-dist/eggs/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/engine/threadlocal.py", line 194, in contextual_connect
    return self.session.get_connection(**kwargs)
  File "/illumina/apps/galaxy/galaxy-dist/eggs/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/engine/threadlocal.py", line 20, in get_connection
    return self.engine.TLConnection(self, self.engine.pool.connect(), close_with_result=close_with_result)
  File "/illumina/apps/galaxy/galaxy-dist/eggs/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/pool.py", line 151, in connect
    agent = _ConnectionFairy(self)
  File "/illumina/apps/galaxy/galaxy-dist/eggs/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/pool.py", line 304, in __init__
    rec = self._connection_record = pool.get()
  File "/illumina/apps/galaxy/galaxy-dist/eggs/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/pool.py", line 161, in get
    return self.do_get()
  File "/illumina/apps/galaxy/galaxy-dist/eggs/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/pool.py", line 639, in do_get
    con = self.create_connection()
  File "/illumina/apps/galaxy/galaxy-dist/eggs/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/pool.py", line 122, in create_connection
    return _ConnectionRecord(self)
  File "/illumina/apps/galaxy/galaxy-dist/eggs/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/pool.py", line 198, in __init__
    self.connection = self.__connect()
  File "/illumina/apps/galaxy/galaxy-dist/eggs/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/pool.py", line 261, in __connect
    connection = self.__pool._creator()
  File "/illumina/apps/galaxy/galaxy-dist/eggs/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/engine/strategies.py", line 80, in connect
    raise exc.DBAPIError.instance(None, None, e)
OperationalError: (OperationalError) FATAL:  Ident authentication failed for user "galaxy"
 None None

请帮我找出哪个是正确的:

  1. Postgresql 是否安装正确,并且我可以从非 root 用户使用它。
  2. 我是否应该从 root 帐户卸载 Postgresql 并在非 root 帐户中重新安装它?当我尝试使用非 root 帐户安装时,它回复“用户不在 sudoers 文件中。此事件将被报告。”

谢谢 Sridhar

答案1

 OperationalError: (OperationalError) FATAL: Ident authentication failed for user "galaxy" None None

表示它正在尝试以用户“galaxy”的身份进行连接。检查您是否能够执行以下操作

  1. 从 postgress CLI 提示符以“galaxy”身份连接
  2. 如果您能够执行#1,则检查您的 python 连接参数中的用户名和密码是否正确。

相关内容