我在本地机器上使用 Acquia Dev Desktop 构建了一个 Drupal 8 站点。我在 AWS EC2 上安装 Drupal,遇到以下错误。
Failed to connect to your database server. The server reports the
following message: SQLSTATE[HY000] [2002] Connection refused.
我用我的 config.inc 文件检查了数据库名称、用户名、密码和端口,但仍然无法连接。这是带有错误的drupal安装页面的屏幕截图:
这是我的 config.inc 文件信息(使用虚拟密码,但真实版本与我在 Drupal 安装页面中输入的内容匹配)
/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '33067';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'mypasswordhere';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['AllowUserDropDatabase'] = true;