Mac OS 10.6.5 中 Postgresql 的 Drupal 7 配置错误 [英] Drupal 7 configuration error with Postgresql in Mac OS 10.6.5

查看:12
本文介绍了Mac OS 10.6.5 中 Postgresql 的 Drupal 7 配置错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Postgres 配置 Drupal 7.在数据库设置步骤,我收到以下错误.

I am trying to configure Drupal 7 with Postgres. At the database setup step, I get the following error.

警告:PDO::_construct(): [2002] DatabaseConnection 中没有这样的文件或目录(试图通过 unix:///var/mysql/mysql.sock 连接)->_construct()(/Users/shamod/Sites/drupal/7/includes/database/database.inc 的第 300 行).为了使 Drupal 正常工作并继续安装过程,您必须解决下面报告的所有问题.有关配置数据库服务器的更多帮助,请参阅安装手册.如果您不确定这意味着什么,您可能应该联系您的托管服务提供商.无法连接到您的数据库服务器.服务器报告以下消息: SQLSTATE[HY000] [2002] 没有这样的文件或目录.数据库服务器是否正在运行?数据库是否存在,您是否输入了正确的数据库名称?您输入了正确的用户名和密码吗?您输入了正确的数据库主机名吗?

Warning: PDO::_construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in DatabaseConnection->_construct() (line 300 of /Users/shamod/Sites/drupal/7/includes/database/database.inc). In order for Drupal to work, and to continue with the installation process, you must resolve all issues reported below. For more help with configuring your database server, see the installation handbook. If you are unsure what any of this means you should probably contact your hosting provider. Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2002] No such file or directory. Is the database server running? Does the database exist, and have you entered the correct database name? Have you entered the correct username and password? Have you entered the correct database hostname?

注意:我正在尝试连接到 Postgresql,但由于 var/mysql/mysql.sock 错误而失败.我已经在 settings.php 中为 Postgresql 设置了数据库连接字符串.还是不行.

NOTE: I am trying to connect to Postgresql but it fails on var/mysql/mysql.sock error. I have setup the database connection string in settings.php for Postgresql. It still does not work.

有什么想法吗?

推荐答案

我自己在尝试使用网络安装程序时遇到了这个错误 - 可能会归结为类似的问题.

Just came up against this error myself when trying to use the web installer - might come down to a similar issue.

在安装页面上,我没有选择使用 Postgres 驱动程序,所以我认为我需要使用Mysql(或其他)"选项.但是,看起来 Drupal 安装脚本会检查哪些数据库驱动程序被编译成 PHP,并且只为您提供可用的 - 我的系统默认没有安装 php-pgsql.

On the install page I wasn't given an option to use Postgres driver so I assumed I needed to use the "Mysql (or other)" option. However, looks like the Drupal install script checks which database drivers are compiled into PHP and only offers you what is available - my system didn't have php-pgsql installed by default.

所以我需要先将 postgresql 驱动安装到 PHP,重新加载 apache,然后再次尝试安装.

So I needed to install the postgresql drivers to PHP first, reload apache then try the install again.

在 CentOS-5 上:

On CentOS-5:

sudo yum install php-pgsql
sudo service httpd restart

然后重新加载安装页面,一切正常.

Then reload the install page and all worked fine.

这篇关于Mac OS 10.6.5 中 Postgresql 的 Drupal 7 配置错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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