成为数据库超级用户-Engineyard [英] Becoming Database Superuser - Engineyard

查看:139
本文介绍了成为数据库超级用户-Engineyard的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将数据库扩展名添加到我的一个应用程序中,尤其是Fuzzystrmatch扩展名。每当我尝试添加它时,都会出现以下错误

I'm trying to add a database extension to one of my applications, specifically the fuzzystrmatch extension. Whenever I try to add it I get the following error

-- execute("CREATE EXTENSION fuzzystrmatch") rake aborted! An error has occurred, this and all later migrations canceled:

PGError: ERROR:  permission denied to create extension "fuzzystrmatch" HINT:  Must be superuser to create this extension. : CREATE EXTENSION fuzzystrmatch

我发现成为超级用户的唯一方法是:

The only thing I've found about becoming a superuser is this:

https ://blog.engineyard.com/2012/postgresql-9-1-is-now-in-beta `

我不知道的是怎么做的?我是否必须ssh进入数据库,然后才需要sudo执行命令?我发现的所有内容都无济于事。谢谢您的帮助。

What I don't know is how to do it? Do I ssh into the database then have to sudo execute the command? Everything I've found has been very unhelpful. Any help is appreciated thanks.

推荐答案

免责声明:我是Engine Yard的DBA之一。

Disclaimer: I'm one of Engine Yard's DBAs.

在Engine Yard上,您的应用程序的DB用户帐户不是超级用户。但是,您确实有权访问超级用户帐户-只需使用 postgres用户即可。显然,您只想将此用于管理任务,而不是从您的应用程序中使用!

On Engine Yard your application's DB user account is not a superuser. You do have access to the superuser account, however - just use the "postgres" user instead. Obviously you would only want to use this for administrative tasks, and not from within your application!

话虽如此,Engine Yard已经提供了一种启用此扩展和其他扩展的方法如您所链接的博客文章结尾所提到的,Postgres。您可以使用厨师食谱来自定义环境,我们提供的食谱可在位于以下位置的自定义厨师仓库中启用postgres扩展:
https://github.com/engineyard/ey-cloud-recipes/tree/master/cookbooks/postgresql9_extensions

That said, Engine Yard already provides a means to enable this and other extensions for Postgres, as mentioned at the end of the blog post you linked. You can customise your environment using chef recipes, and we provide recipes to enable postgres extensions in our custom chef repo located at: https://github.com/engineyard/ey-cloud-recipes/tree/master/cookbooks/postgresql9_extensions

如果您已经在环境中使用自定义厨师食谱,则应该直接进行设置-否则,我建议您从此处的文档开始:
https://support.cloud.engineyard.com/entries/21009867-Customize -您的带厨师食谱的环境

If you're already using custom chef recipes in your environment then getting that set up should be straight forward - if not, I recommend you start with the documentation here: https://support.cloud.engineyard.com/entries/21009867-Customize-Your-Environment-with-Chef-Recipes

如果您遇到任何麻烦,请打开一张票,我们将很高兴协助!

If you run into trouble with any of this, then please open a ticket and we'll be glad to assist!

这篇关于成为数据库超级用户-Engineyard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆