最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

解决drushPDOException:SQLSTATE[HY000][2002]问题的办法分析

来源:懂视网 责编:小采 时间:2020-11-09 13:02:10
文档

解决drushPDOException:SQLSTATE[HY000][2002]问题的办法分析

解决drushPDOException:SQLSTATE[HY000][2002]问题的办法分析:今天在Mac OS中http://www.gxlcms.com/php/php-tp-inst安装Drush时遇到一个错误。Drush command terminated abnormally due to an unrecoverable error. [error] <h1>Additional uncaught except
推荐度:
导读解决drushPDOException:SQLSTATE[HY000][2002]问题的办法分析:今天在Mac OS中http://www.gxlcms.com/php/php-tp-inst安装Drush时遇到一个错误。Drush command terminated abnormally due to an unrecoverable error. [error] <h1>Additional uncaught except

今天在Mac OS中http://www.gxlcms.com/php/php-tp-inst安装Drush时遇到一个错误。

Drush command terminated abnormally due to an unrecoverable error. [error] 
<h1>Additional uncaught exception thrown while handling exception.</h1> 
<h2>Original</h2> 
<p>PDOException: SQLSTATE[HY000] [2002] No such file or directory in drupal_is_denied() 
(line 1915 of /Applications/rubystack/apps/drupal/htdocs/includes/bootstrap.inc).</p> 
<h2>Additional</h2> 
<p>PDOException: SQLSTATE[HY000] [2002] No such file or directory in system_list() 
(line 165 of /Applications/rubystack/apps/drupal/htdocs/includes/module.inc).</p><hr />
Process finished with exit code 1 at 17:04:06. 
Execution time: 221 ms.

这个问题错误主要时PDOException: SQLSTATE[HY000] [2002]来自MySQL连接上。

解决方法

在Drupal的默认settings.php文件中加入mysql 加入unix_socket。

array (
'database' => 'demo_drupal',
'username' => 'root',
'password' => '',
'host' => 'localhost',
'port' => '3309',
'unix_socket' => '/Applications/rubystack/mysql/tmp/mysql.sock',
'driver' => 'mysql',
'prefix' => '',
)

检查drush是否正常工作,只需输入drush status来读取信息正常,就说明安装成功了。

如下演示:

lixideMacBook-Pro:htdocs lixi$ /Users/lixi/drush/drush status 
Drupal version : 7.25 
Site URI : http://default 
Database driver : mysql 
Database username : root 
Database name : demo_drupal 
Database : Connected 
Drupal bootstrap : Successful 
Drupal user : 
Default theme : bartik 
Administration theme : seven 
PHP executable : /usr/bin/php 
PHP configuration : 
PHP OS : Darwin 
Drush version : 7.0-dev 
Drush configuration : 
Drush alias files : 
Drupal root : /Applications/rubystack/apps/drupal/htdocs 
Site path : sites/default 
File directory path : sites/default/files 
Temporary file directory path : /Applications/rubystack/php/tmp

Drush 升级 Drupal

使用drush up命令来升级drupal。

lixideMacBook-Pro:htdocs lixi$ /Users/lixi/drush/drush up 
Name Installed Version Proposed version Message 
Drupal 7.25 7.26 SECURITY UPDATE available
Update information last refreshed: Sun, 01/19/2014 – 13:58 
Code updates will be made to drupal core. 
WARNING: Updating core will discard any modifications made to Drupal core files, 
most noteworthy among these are .htaccess and robots.txt. 
If you have made any modifications to these files, 
please back them up before updating so that you can re-create your modifications in the 
updated version of the file. 
Note: Updating core can potentially break your site. 
It is NOT recommended to update production sites without prior testing.
Do you really want to continue? (y/n): y 
Project drupal was updated successfully. Installed version is now 7.26. 
Backups were saved into the directory [ok] 
/Users/lixi/drush-backups/bitnami_drupal7/20140120095445/drupal. 
Taxonomy 7011 Drop unpublished nodes from the index. 
Do you wish to run all pending updates? (y/n): y 
Performed update: taxonomy_update_7011 [ok] 
‘all’ cache was cleared. [success] 
Finished performing updates. [ok]

文档

解决drushPDOException:SQLSTATE[HY000][2002]问题的办法分析

解决drushPDOException:SQLSTATE[HY000][2002]问题的办法分析:今天在Mac OS中http://www.gxlcms.com/php/php-tp-inst安装Drush时遇到一个错误。Drush command terminated abnormally due to an unrecoverable error. [error] <h1>Additional uncaught except
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top